Bug 1500709 - fix big-endian RGBBitShift in Swizzle. r=me
authorLee Salzman <lsalzman@mozilla.com>
Mon, 22 Oct 2018 14:49:08 -0400 (2018-10-22)
changeset 442385 f0f7573deea111d97bc96aa6b33e2518ee89da3a
parent 442384 2ce8f6d1a64ef8ee845c595bc441234af72422fe
child 442386 d2f1265ca977cab4b65a81aff3902ee7f02d5a06
push id109157
push userlsalzman@mozilla.com
push dateMon, 22 Oct 2018 18:50:52 +0000 (2018-10-22)
treeherdermozilla-inbound@f0f7573deea1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1500709
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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;