e98f2c
diff -up firefox-78.0/gfx/2d/DrawTargetSkia.cpp.mozilla-bmo1504834-part1 firefox-78.0/gfx/2d/DrawTargetSkia.cpp
e98f2c
--- firefox-78.0/gfx/2d/DrawTargetSkia.cpp.mozilla-bmo1504834-part1	2020-06-17 04:18:58.000000000 +0200
e98f2c
+++ firefox-78.0/gfx/2d/DrawTargetSkia.cpp	2020-06-25 16:52:29.824532769 +0200
e98f2c
@@ -135,8 +135,7 @@ static IntRect CalculateSurfaceBounds(co
5bf1f5
   return surfaceBounds.Intersect(bounds);
5bf1f5
 }
5bf1f5
 
5bf1f5
-static const int kARGBAlphaOffset =
5bf1f5
-    SurfaceFormat::A8R8G8B8_UINT32 == SurfaceFormat::B8G8R8A8 ? 3 : 0;
5bf1f5
+static const int kARGBAlphaOffset = 0;  // Skia is always BGRA SurfaceFormat::A8R8G8B8_UINT32 == SurfaceFormat::B8G8R8A8 ? 3 : 0;
5bf1f5
 
5bf1f5
 static bool VerifyRGBXFormat(uint8_t* aData, const IntSize& aSize,
5bf1f5
                              const int32_t aStride, SurfaceFormat aFormat) {
e98f2c
diff -up firefox-78.0/gfx/2d/Types.h.mozilla-bmo1504834-part1 firefox-78.0/gfx/2d/Types.h
e98f2c
--- firefox-78.0/gfx/2d/Types.h.mozilla-bmo1504834-part1	2020-06-25 16:52:29.826532776 +0200
e98f2c
+++ firefox-78.0/gfx/2d/Types.h	2020-06-25 16:55:02.942063616 +0200
e98f2c
@@ -90,15 +90,8 @@ enum class SurfaceFormat : int8_t {
5bf1f5
 // The following values are endian-independent synonyms. The _UINT32 suffix
5bf1f5
 // indicates that the name reflects the layout when viewed as a uint32_t
5bf1f5
 // value.
e98f2c
-#if MOZ_LITTLE_ENDIAN()
5bf1f5
   A8R8G8B8_UINT32 = B8G8R8A8,  // 0xAARRGGBB
e98f2c
   X8R8G8B8_UINT32 = B8G8R8X8,  // 0x00RRGGBB
e98f2c
-#elif MOZ_BIG_ENDIAN()
5bf1f5
-  A8R8G8B8_UINT32 = A8R8G8B8,  // 0xAARRGGBB
e98f2c
-  X8R8G8B8_UINT32 = X8R8G8B8,  // 0x00RRGGBB
5bf1f5
-#else
5bf1f5
-#  error "bad endianness"
5bf1f5
-#endif
5bf1f5
 
e98f2c
   // The following values are OS and endian-independent synonyms.
e98f2c
   //
e98f2c
diff -up firefox-78.0/gfx/skia/skia/third_party/skcms/skcms.cc.mozilla-bmo1504834-part1 firefox-78.0/gfx/skia/skia/third_party/skcms/skcms.cc
e98f2c
--- firefox-78.0/gfx/skia/skia/third_party/skcms/skcms.cc.mozilla-bmo1504834-part1	2020-06-17 04:18:58.000000000 +0200
e98f2c
+++ firefox-78.0/gfx/skia/skia/third_party/skcms/skcms.cc	2020-06-25 16:54:02.993855444 +0200
e98f2c
@@ -30,6 +30,8 @@
e98f2c
         #include <avx512fintrin.h>
e98f2c
         #include <avx512dqintrin.h>
e98f2c
     #endif
5bf1f5
+#else
5bf1f5
+    #define SKCMS_PORTABLE
5bf1f5
 #endif
5bf1f5
 
5bf1f5
 // sizeof(x) will return size_t, which is 32-bit on some machines and 64-bit on others.
e98f2c
@@ -280,20 +282,28 @@ enum {
5bf1f5
 static uint16_t read_big_u16(const uint8_t* ptr) {
5bf1f5
     uint16_t be;
5bf1f5
     memcpy(&be, ptr, sizeof(be));
5bf1f5
-#if defined(_MSC_VER)
e98f2c
-    return _byteswap_ushort(be);
5bf1f5
+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
5bf1f5
+    return be;
e98f2c
 #else
5bf1f5
+    #if defined(_MSC_VER)
e98f2c
+    return _byteswap_ushort(be);
5bf1f5
+    #else
5bf1f5
     return __builtin_bswap16(be);
5bf1f5
+    #endif
5bf1f5
 #endif
5bf1f5
 }
5bf1f5
 
5bf1f5
 static uint32_t read_big_u32(const uint8_t* ptr) {
5bf1f5
     uint32_t be;
5bf1f5
     memcpy(&be, ptr, sizeof(be));
5bf1f5
-#if defined(_MSC_VER)
e98f2c
-    return _byteswap_ulong(be);
5bf1f5
+#if __BYTE_ORDER == __ORDER_BIG_ENDIAN__
5bf1f5
+    return be;
e98f2c
 #else
5bf1f5
+    #if defined(_MSC_VER)
e98f2c
+    return _byteswap_ulong(be);
5bf1f5
+    #else
5bf1f5
     return __builtin_bswap32(be);
5bf1f5
+    #endif
5bf1f5
 #endif
5bf1f5
 }
5bf1f5