diff -r 52b1745787cf -r 146af4f081b9 mozilla-bmo1504834-part2.patch --- a/mozilla-bmo1504834-part2.patch Mon Nov 25 08:41:45 2019 +0100 +++ b/mozilla-bmo1504834-part2.patch Thu Jun 11 22:04:26 2020 +0200 @@ -1,5 +1,5 @@ # HG changeset patch -# Parent 6fa4b62427433e8f445d05c557e5db096667d880 +# Parent 9319844dca3133fa8bd7107079f1d1ddc5c0bf70 Skia does not support big endian. The places to fix are too numerous and upstream (skia, not Mozilla) has no interest in maintaining big endian. So here we try to swizzle the input for skia, so that skia always works on LE, and when it comes @@ -8,7 +8,7 @@ diff --git a/gfx/2d/ConvolutionFilter.cpp b/gfx/2d/ConvolutionFilter.cpp --- a/gfx/2d/ConvolutionFilter.cpp +++ b/gfx/2d/ConvolutionFilter.cpp -@@ -30,32 +30,79 @@ bool ConvolutionFilter::GetFilterOffsetA +@@ -29,32 +29,79 @@ bool ConvolutionFilter::GetFilterOffsetA int32_t* aResultLength) { if (aRowIndex >= mFilter->numValues()) { return false; @@ -28,7 +28,7 @@ + void ConvolutionFilter::ConvolveHorizontally(const uint8_t* aSrc, uint8_t* aDst, bool aHasAlpha) { -+#if MOZ_BIG_ENDIAN ++#if MOZ_BIG_ENDIAN() + int outputSize = mFilter->numValues(); + + // Input size isn't handed in, so we have to calculate it quickly @@ -45,7 +45,7 @@ + SkOpts::convolve_horizontally(aSrc, *mFilter, aDst, aHasAlpha); + -+#if MOZ_BIG_ENDIAN ++#if MOZ_BIG_ENDIAN() + ByteSwapArray((uint8_t*)aSrc, inputSize); + ByteSwapArray(aDst, outputSize); +#endif @@ -61,7 +61,7 @@ auto filterValues = mFilter->FilterForValue(aRowIndex, &filterOffset, &filterLength); + -+#if MOZ_BIG_ENDIAN ++#if MOZ_BIG_ENDIAN() + for (int filterY = 0; filterY < filterLength; filterY++) { + // Skia only knows LE, so we have to swizzle the input + ByteSwapArray(aSrc[filterY], aRowSize); @@ -71,7 +71,7 @@ SkOpts::convolve_vertically(filterValues, filterLength, aSrc, aRowSize, aDst, aHasAlpha); + -+#if MOZ_BIG_ENDIAN ++#if MOZ_BIG_ENDIAN() + // After skia is finished, we swizzle back to BE, in case + // the input is used again somewhere else + for (int filterY = 0; filterY < filterLength; filterY++) {