From 78dd4ea8ff733f5b1d1c4bafdb7898da00c03760 Mon Sep 17 00:00:00 2001 From: Cameron Kaiser Date: Mon, 4 Dec 2017 22:00:17 -0800 Subject: [PATCH] #452: better endian fix for SurfaceFormat (M1209812/M986328) --- gfx/2d/HelpersCairo.h | 2 -- gfx/2d/Types.h | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/gfx/2d/HelpersCairo.h b/gfx/2d/HelpersCairo.h index b844f2cfd..53e9163c5 100644 --- a/gfx/2d/HelpersCairo.h +++ b/gfx/2d/HelpersCairo.h @@ -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; diff --git a/gfx/2d/Types.h b/gfx/2d/Types.h index 36dc34297..015757d72 100644 --- a/gfx/2d/Types.h +++ b/gfx/2d/Types.h @@ -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