Bug 1500709 - fix big-endian RGBBitShift in Swizzle. r=me
authorLee Salzman <lsalzman@mozilla.com>
Mon, 22 Oct 2018 14:49:08 -0400
changeset 442385 f0f7573deea1
parent 442384 2ce8f6d1a64e
child 442386 d2f1265ca977
push id109157
push userlsalzman@mozilla.com
push dateMon, 22 Oct 2018 18:50:52 +0000
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;