From f7239e20fcb4ec168cd744874c1ab39d3dd9ec8c Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Thu, 24 May 2018 14:50:31 -0400 Subject: [PATCH] Bug 1144632 - fix big-endian Skia builds. r=rhunt 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 | 15 ++++----------- gfx/skia/skia/include/core/SkImageInfo.h | 2 +- gfx/skia/skia/include/gpu/GrTypes.h | 5 +---- gfx/skia/skia/src/core/SkColorData.h | 15 ++++----------- 4 files changed, 10 insertions(+), 27 deletions(-) diff --git a/gfx/skia/skia/include/core/SkColorPriv.h b/gfx/skia/skia/include/core/SkColorPriv.h index 0cd02e80340..8a7f1501ba4 100644 --- a/gfx/skia/skia/include/core/SkColorPriv.h +++ b/gfx/skia/skia/include/core/SkColorPriv.h @@ -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) diff --git a/gfx/skia/skia/include/core/SkImageInfo.h b/gfx/skia/skia/include/core/SkImageInfo.h index ece47f5c418..5b36ba1e451 100644 --- a/gfx/skia/skia/include/core/SkImageInfo.h +++ b/gfx/skia/skia/include/core/SkImageInfo.h @@ -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 }; diff --git a/gfx/skia/skia/include/gpu/GrTypes.h b/gfx/skia/skia/include/gpu/GrTypes.h index c88d9ee63b3..fdca5f29e52 100644 --- a/gfx/skia/skia/include/gpu/GrTypes.h +++ b/gfx/skia/skia/include/gpu/GrTypes.h @@ -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 /** diff --git a/gfx/skia/skia/src/core/SkColorData.h b/gfx/skia/skia/src/core/SkColorData.h index 3fc0113105a..43ae01eeaee 100644 --- a/gfx/skia/skia/src/core/SkColorData.h +++ b/gfx/skia/skia/src/core/SkColorData.h @@ -32,17 +32,10 @@ * 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" -- 2.30.2