Skip to content

Commit

Permalink
#452: better endian fix for SurfaceFormat (M1209812/M986328)
Browse files Browse the repository at this point in the history
  • Loading branch information
classilla committed Dec 5, 2017
1 parent dfaeb3f commit 78dd4ea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions gfx/2d/HelpersCairo.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,8 @@ GfxFormatToCairoFormat(SurfaceFormat format)
switch (format)
{
case SurfaceFormat::A8R8G8B8_UINT32:
case SurfaceFormat::B8G8R8A8: // XXX?
return CAIRO_FORMAT_ARGB32;
case SurfaceFormat::X8R8G8B8_UINT32:
case SurfaceFormat::B8G8R8X8: // XXX?
return CAIRO_FORMAT_RGB24;
case SurfaceFormat::A8:
return CAIRO_FORMAT_A8;
Expand Down
4 changes: 2 additions & 2 deletions gfx/2d/Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ enum class SurfaceFormat : int8_t {
// The following values are endian-independent synonyms. The _UINT32 suffix
// indicates that the name reflects the layout when viewed as a uint32_t
// value.
#if MOZ_LITTLE_ENDIAN
#if MOZ_BIG_ENDIAN
A8R8G8B8_UINT32 = B8G8R8A8, // 0xAARRGGBB
X8R8G8B8_UINT32 = B8G8R8X8 // 0x00RRGGBB
#elif MOZ_BIG_ENDIAN
#elif MOZ_LITTLE_ENDIAN
A8R8G8B8_UINT32 = A8R8G8B8, // 0xAARRGGBB
X8R8G8B8_UINT32 = X8R8G8B8 // 0x00RRGGBB
#else
Expand Down

0 comments on commit 78dd4ea

Please sign in to comment.