diff -r 6168af2507a2 -r 004e4b1efb26 mozilla-bmo1504834-part1.patch --- a/mozilla-bmo1504834-part1.patch Sun Feb 09 08:35:05 2020 +0100 +++ b/mozilla-bmo1504834-part1.patch Wed Feb 19 22:51:20 2020 +0100 @@ -1,11 +1,16 @@ # HG changeset patch -# Parent 83da7ee18178639b2a89d5e21f78e190e4e72d7e +# Parent 9db312f823881c04c5c16a7623df08cf6aef371d Taken from https://bugzilla.mozilla.org/show_bug.cgi?id=1504834 -diff -r 83da7ee18178 gfx/2d/DrawTargetSkia.cpp ---- a/gfx/2d/DrawTargetSkia.cpp Mon Jul 22 00:00:00 2019 +0200 -+++ b/gfx/2d/DrawTargetSkia.cpp Wed Jan 08 12:17:44 2020 +0100 -@@ -136,8 +136,7 @@ +diff --git a/gfx/2d/DrawTargetSkia.cpp b/gfx/2d/DrawTargetSkia.cpp +--- a/gfx/2d/DrawTargetSkia.cpp ++++ b/gfx/2d/DrawTargetSkia.cpp +@@ -131,18 +131,17 @@ static IntRect CalculateSurfaceBounds(co + Rect sampledBounds = inverse.TransformBounds(*aBounds); + if (!sampledBounds.ToIntRect(&bounds)) { + return surfaceBounds; + } + return surfaceBounds.Intersect(bounds); } @@ -15,17 +20,27 @@ static bool VerifyRGBXFormat(uint8_t* aData, const IntSize& aSize, const int32_t aStride, SurfaceFormat aFormat) { -diff -r 83da7ee18178 gfx/2d/Types.h ---- a/gfx/2d/Types.h Mon Jul 22 00:00:00 2019 +0200 -+++ b/gfx/2d/Types.h Wed Jan 08 12:17:44 2020 +0100 -@@ -86,15 +86,8 @@ + if (aFormat != SurfaceFormat::B8G8R8X8 || aSize.IsEmpty()) { + return true; + } + // We should've initialized the data to be opaque already + // On debug builds, verify that this is actually true. +diff --git a/gfx/2d/Types.h b/gfx/2d/Types.h +--- a/gfx/2d/Types.h ++++ b/gfx/2d/Types.h +@@ -82,25 +82,18 @@ enum class SurfaceFormat : int8_t { + Depth, + + // This represents the unknown format. + UNKNOWN, + // The following values are endian-independent synonyms. The _UINT32 suffix // indicates that the name reflects the layout when viewed as a uint32_t // value. --#if MOZ_LITTLE_ENDIAN +-#if MOZ_LITTLE_ENDIAN() A8R8G8B8_UINT32 = B8G8R8A8, // 0xAARRGGBB X8R8G8B8_UINT32 = B8G8R8X8, // 0x00RRGGBB --#elif MOZ_BIG_ENDIAN +-#elif MOZ_BIG_ENDIAN() - A8R8G8B8_UINT32 = A8R8G8B8, // 0xAARRGGBB - X8R8G8B8_UINT32 = X8R8G8B8, // 0x00RRGGBB -#else @@ -34,10 +49,20 @@ // The following values are OS and endian-independent synonyms. // -diff -r 83da7ee18178 gfx/skia/skia/third_party/skcms/skcms.cc ---- a/gfx/skia/skia/third_party/skcms/skcms.cc Mon Jul 22 00:00:00 2019 +0200 -+++ b/gfx/skia/skia/third_party/skcms/skcms.cc Wed Jan 08 12:17:44 2020 +0100 -@@ -30,6 +30,8 @@ + // TODO(aosmond): When everything blocking bug 1581828 has been resolved, we + // can make this use R8B8G8A8 and R8B8G8X8 for non-Windows platforms. + OS_RGBA = A8R8G8B8_UINT32, + OS_RGBX = X8R8G8B8_UINT32 + }; +diff --git a/gfx/skia/skia/third_party/skcms/skcms.cc b/gfx/skia/skia/third_party/skcms/skcms.cc +--- a/gfx/skia/skia/third_party/skcms/skcms.cc ++++ b/gfx/skia/skia/third_party/skcms/skcms.cc +@@ -25,16 +25,18 @@ + // it'd be a lot slower. But we want all those headers included so we + // can use their features after runtime checks later. + #include + #include + #include #include #include #endif @@ -46,7 +71,17 @@ #endif // sizeof(x) will return size_t, which is 32-bit on some machines and 64-bit on others. -@@ -280,20 +282,28 @@ + // We have better testing on 64-bit machines, so force 32-bit machines to behave like 64-bit. + // + // Please do not use sizeof() directly, and size_t only when required. + // (We have no way of enforcing these requests...) + #define SAFE_SIZEOF(x) ((uint64_t)sizeof(x)) +@@ -275,30 +277,38 @@ enum { + skcms_Signature_sf32 = 0x73663332, + // XYZ is also a PCS signature, so it's defined in skcms.h + // skcms_Signature_XYZ = 0x58595A20, + }; + static uint16_t read_big_u16(const uint8_t* ptr) { uint16_t be; memcpy(&be, ptr, sizeof(be)); @@ -79,3 +114,8 @@ #endif } + static int32_t read_big_i32(const uint8_t* ptr) { + return (int32_t)read_big_u32(ptr); + } + + static float read_big_fixed(const uint8_t* ptr) {