Bug 1500709 - fix big-endian RGBBitShift in Swizzle. r=me
authorLee Salzman <lsalzman@mozilla.com>
Mon, 22 Oct 2018 14:49:08 -0400
changeset 490717 f0f7573deea111d97bc96aa6b33e2518ee89da3a
parent 490716 2ce8f6d1a64ef8ee845c595bc441234af72422fe
child 490718 d2f1265ca977cab4b65a81aff3902ee7f02d5a06
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersme
bugs1500709
milestone65.0a1
Bug 1500709 - fix big-endian RGBBitShift in Swizzle. r=me CLOSED TREE
gfx/2d/Swizzle.cpp
--- a/gfx/2d/Swizzle.cpp
+++ b/gfx/2d/Swizzle.cpp
@@ -82,17 +82,17 @@ AlphaByteIndex(SurfaceFormat aFormat)
 
 // The endian-dependent bit shift to access RGB of a UINT32 pixel.
 static constexpr uint32_t
 RGBBitShift(SurfaceFormat aFormat)
 {
 #if MOZ_LITTLE_ENDIAN
   return 8 * RGBByteIndex(aFormat);
 #else
-  return 24 - 8 * RGBByteIndex(aFormat);
+  return 8 - 8 * RGBByteIndex(aFormat);
 #endif
 }
 
 // The endian-dependent bit shift to access alpha of a UINT32 pixel.
 static constexpr uint32_t
 AlphaBitShift(SurfaceFormat aFormat)
 {
   return (RGBBitShift(aFormat) + 24) % 32;