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