#452: better endian fix for SurfaceFormat (M1209812/M986328)

This commit is contained in:
Cameron Kaiser 2017-12-04 22:00:17 -08:00
parent dfaeb3f24a
commit 78dd4ea8ff
2 changed files with 2 additions and 4 deletions

View File

@ -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;

View File

@ -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