Skip to content

Commit

Permalink
Bug 1055265 - Correct the SkColorType used for 32-bit in SkANP r=snorp
Browse files Browse the repository at this point in the history
  • Loading branch information
George Wright committed Aug 28, 2014
1 parent d349beb commit 1772aea
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 26 deletions.
5 changes: 0 additions & 5 deletions gfx/2d/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,6 @@ for var in ('USE_CAIRO', 'MOZ2D_HAS_MOZ_CAIRO'):
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gtk2', 'gtk3', 'gonk', 'qt'):
DEFINES['MOZ_ENABLE_FREETYPE'] = True

DEFINES['SK_A32_SHIFT'] = 24
DEFINES['SK_R32_SHIFT'] = 16
DEFINES['SK_G32_SHIFT'] = 8
DEFINES['SK_B32_SHIFT'] = 0

if CONFIG['MOZ_DEBUG']:
DEFINES['GFX_LOG_DEBUG'] = True
DEFINES['GFX_LOG_WARNING'] = True
Expand Down
5 changes: 0 additions & 5 deletions gfx/skia/generate_mozbuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,6 @@
'trunk/src/utils/win',
]
DEFINES['SK_A32_SHIFT'] = 24
DEFINES['SK_R32_SHIFT'] = 16
DEFINES['SK_G32_SHIFT'] = 8
DEFINES['SK_B32_SHIFT'] = 0
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gtk2', 'gtk3', 'qt', 'gonk', 'cocoa'):
DEFINES['SK_USE_POSIX_THREADS'] = 1
Expand Down
5 changes: 0 additions & 5 deletions gfx/skia/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -908,11 +908,6 @@ LOCAL_INCLUDES += [
'trunk/src/utils/win',
]

DEFINES['SK_A32_SHIFT'] = 24
DEFINES['SK_R32_SHIFT'] = 16
DEFINES['SK_G32_SHIFT'] = 8
DEFINES['SK_B32_SHIFT'] = 0

if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gtk2', 'gtk3', 'qt', 'gonk', 'cocoa'):
DEFINES['SK_USE_POSIX_THREADS'] = 1

Expand Down
16 changes: 6 additions & 10 deletions gfx/skia/trunk/include/config/SkUserConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,16 +151,6 @@
*/
//#undef SK_USER_TRACE_INCLUDE_FILE

/* Change the ordering to work in X windows.
*/
#ifdef SK_SAMPLES_FOR_X
#define SK_R32_SHIFT 16
#define SK_G32_SHIFT 8
#define SK_B32_SHIFT 0
#define SK_A32_SHIFT 24
#endif


/* Determines whether to build code that supports the GPU backend. Some classes
that are not GPU-specific, such as SkShader subclasses, have optional code
that is used allows them to interact with the GPU backend. If you'd like to
Expand Down Expand Up @@ -202,6 +192,12 @@
# define SK_BARRIERS_PLATFORM_H "skia/SkBarriers_x86.h"
#endif

// On all platforms we have this byte order
#define SK_A32_SHIFT 24
#define SK_R32_SHIFT 16
#define SK_G32_SHIFT 8
#define SK_B32_SHIFT 0

#define SK_ALLOW_STATIC_GLOBAL_INITIALIZERS 0

#define SK_SUPPORT_LEGACY_GETDEVICE
Expand Down
4 changes: 3 additions & 1 deletion other-licenses/skia-npapi/SkANP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ SkBitmap* SkANP::SetBitmap(SkBitmap* dst, const ANPBitmap& src) {

switch (src.format) {
case kRGBA_8888_ANPBitmapFormat:
colorType = kRGBA_8888_SkColorType;
// Let Skia choose the correct colour type for us based on its
// endianness. This should be correct.
colorType = kN32_SkColorType;
break;
case kRGB_565_ANPBitmapFormat:
colorType = kRGB_565_SkColorType;
Expand Down

0 comments on commit 1772aea

Please sign in to comment.