Bug 1144632 - fix big-endian Skia builds. r=rhunt
authorLee Salzman <lsalzman@mozilla.com>
Thu, 24 May 2018 18:50:31 +0000 (14:50 -0400)
committerMike Hommey <glandium@debian.org>
Thu, 14 Feb 2019 09:35:06 +0000 (09:35 +0000)
MozReview-Commit-ID: JQivGBE45qy

Gbp-Pq: Topic fixes
Gbp-Pq: Name Bug-1144632-fix-big-endian-Skia-builds.-r-rhunt.patch

gfx/skia/skia/include/core/SkColorPriv.h
gfx/skia/skia/include/core/SkImageInfo.h
gfx/skia/skia/include/gpu/GrTypes.h
gfx/skia/skia/src/core/SkColorData.h

index 0cd02e8034062b4362b271ad40ea2165d9dc38d5..8a7f1501ba43494ac96f916a10fdc4d7e179649d 100644 (file)
@@ -55,17 +55,10 @@ static inline U8CPU SkUnitScalarClampToByte(SkScalar x) {
  *  Here we enforce this constraint.
  */
 
-#ifdef SK_CPU_BENDIAN
-    #define SK_RGBA_R32_SHIFT   24
-    #define SK_RGBA_G32_SHIFT   16
-    #define SK_RGBA_B32_SHIFT   8
-    #define SK_RGBA_A32_SHIFT   0
-#else
-    #define SK_RGBA_R32_SHIFT   0
-    #define SK_RGBA_G32_SHIFT   8
-    #define SK_RGBA_B32_SHIFT   16
-    #define SK_RGBA_A32_SHIFT   24
-#endif
+#define SK_RGBA_R32_SHIFT   0
+#define SK_RGBA_G32_SHIFT   8
+#define SK_RGBA_B32_SHIFT   16
+#define SK_RGBA_A32_SHIFT   24
 
 #define SkGetPackedA32(packed)      ((uint32_t)((packed) << (24 - SK_A32_SHIFT)) >> 24)
 #define SkGetPackedR32(packed)      ((uint32_t)((packed) << (24 - SK_R32_SHIFT)) >> 24)
index ece47f5c418a87708d1d2f47bdf68c638cb0197f..5b36ba1e4518a56ee0bb5645bd0fef3a6280b86e 100644 (file)
@@ -84,7 +84,7 @@ enum SkColorType {
 #elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A)
     kN32_SkColorType = kRGBA_8888_SkColorType,
 #else
-    #error "SK_*32_SHIFT values must correspond to BGRA or RGBA byte order"
+    kN32_SkColorType = kBGRA_8888_SkColorType,
 #endif
 };
 
index c88d9ee63b38f86d4b612c8cfc8bfb5faccba57e..fdca5f29e527b6da52cba72dba4f75676c3cba77 100644 (file)
@@ -344,15 +344,12 @@ enum GrPixelConfig {
 static const int kGrPixelConfigCnt = kLast_GrPixelConfig + 1;
 
 // Aliases for pixel configs that match skia's byte order.
-#ifndef SK_CPU_LENDIAN
-    #error "Skia gpu currently assumes little endian"
-#endif
 #if SK_PMCOLOR_BYTE_ORDER(B,G,R,A)
     static const GrPixelConfig kSkia8888_GrPixelConfig = kBGRA_8888_GrPixelConfig;
 #elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A)
     static const GrPixelConfig kSkia8888_GrPixelConfig = kRGBA_8888_GrPixelConfig;
 #else
-    #error "SK_*32_SHIFT values must correspond to GL_BGRA or GL_RGBA format."
+    static const GrPixelConfig kSkia8888_GrPixelConfig = kBGRA_8888_GrPixelConfig;
 #endif
 
 /**
index 3fc0113105a5b2d54684439756925b9dbbda9534..43ae01eeaee3e5b57df7dd4951737acbd34b5f0e 100644 (file)
  *  Here we enforce this constraint.
  */
 
-#ifdef SK_CPU_BENDIAN
-    #define SK_BGRA_B32_SHIFT   24
-    #define SK_BGRA_G32_SHIFT   16
-    #define SK_BGRA_R32_SHIFT   8
-    #define SK_BGRA_A32_SHIFT   0
-#else
-    #define SK_BGRA_B32_SHIFT   0
-    #define SK_BGRA_G32_SHIFT   8
-    #define SK_BGRA_R32_SHIFT   16
-    #define SK_BGRA_A32_SHIFT   24
-#endif
+#define SK_BGRA_B32_SHIFT   0
+#define SK_BGRA_G32_SHIFT   8
+#define SK_BGRA_R32_SHIFT   16
+#define SK_BGRA_A32_SHIFT   24
 
 #if defined(SK_PMCOLOR_IS_RGBA) && defined(SK_PMCOLOR_IS_BGRA)
     #error "can't define PMCOLOR to be RGBA and BGRA"