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