summaryrefslogtreecommitdiff
path: root/experimental/firefox-esr/endian-gfx.patch
blob: ec81a9ceedf7862628a447b74c57de8626b38627 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# HG changeset patch
# User Lee Salzman <lsalzman@mozilla.com>
# Date 1540234148 14400
# Node ID f0f7573deea111d97bc96aa6b33e2518ee89da3a
# Parent  2ce8f6d1a64ef8ee845c595bc441234af72422fe
Bug 1500709 - fix big-endian RGBBitShift in Swizzle. r=me
CLOSED TREE

diff --git a/gfx/2d/Swizzle.cpp b/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;