--- a/mozilla-bmo1511604.patch Mon Sep 09 23:36:13 2019 +0200
+++ b/mozilla-bmo1511604.patch Sat Sep 14 10:56:02 2019 +0200
@@ -3,7 +3,7 @@
# Date 1543674229 0
# Sat Dec 01 14:23:49 2018 +0000
# Node ID 0309ff19e46b126c527e633518d7de8570442114
-# Parent 53107afbc21ec78e7ac46d37af212505f2032d5d
+# Parent ba2c9b0542c95cc5ee26c264e8338fc9ba94c958
Bug 1511604 - Swizzle YCbCr->RGB data on big-endian machines
Taken from https://bugzilla.mozilla.org/show_bug.cgi?id=1511604
@@ -11,10 +11,12 @@
Again, input for skia is swizzled to LE, as skia only understands LE.
-diff -r 53107afbc21e -r 0309ff19e46b gfx/ycbcr/YCbCrUtils.cpp
---- a/gfx/ycbcr/YCbCrUtils.cpp Wed Nov 07 04:50:21 2018 +0000
-+++ b/gfx/ycbcr/YCbCrUtils.cpp Sat Dec 01 14:23:49 2018 +0000
-@@ -3,7 +3,9 @@
+diff --git a/gfx/ycbcr/YCbCrUtils.cpp b/gfx/ycbcr/YCbCrUtils.cpp
+--- a/gfx/ycbcr/YCbCrUtils.cpp
++++ b/gfx/ycbcr/YCbCrUtils.cpp
+@@ -1,14 +1,16 @@
+ /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ * This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@@ -24,11 +26,21 @@
#include "YCbCrUtils.h"
#include "yuv_convert.h"
-@@ -236,6 +238,13 @@
+ #include "ycbcr_to_rgb565.h"
+
+ namespace mozilla {
+ namespace gfx {
+
+@@ -231,16 +233,23 @@ ConvertYCbCrToRGB(const layers::PlanarYC
+ srcData.mPicSize.width,
+ srcData.mPicSize.height,
+ srcData.mYStride,
+ srcData.mCbCrStride,
+ aStride,
yuvtype,
srcData.mYUVColorSpace);
}
-+#ifdef MOZ_BIG_ENDIAN
++#if MOZ_BIG_ENDIAN
+ // libyuv makes endian-correct result, which needs to be swapped to BGRX
+ if (aDestFormat != SurfaceFormat::R5G6B5_UINT16)
+ gfx::SwizzleData(aDestBuffer, aStride, gfx::SurfaceFormat::X8R8G8B8,
@@ -38,11 +50,21 @@
}
void
-@@ -257,6 +266,12 @@
+ ConvertYCbCrAToARGB(const uint8_t* aSrcY,
+ const uint8_t* aSrcU,
+ const uint8_t* aSrcV,
+ const uint8_t* aSrcA,
+ int aSrcStrideYA, int aSrcStrideUV,
+@@ -252,12 +261,18 @@ ConvertYCbCrAToARGB(const uint8_t* aSrcY
+ aSrcV,
+ aSrcA,
+ aDstARGB,
+ aWidth,
+ aHeight,
aSrcStrideYA,
aSrcStrideUV,
aDstStrideARGB);
-+#ifdef MOZ_BIG_ENDIAN
++#if MOZ_BIG_ENDIAN
+ // libyuv makes endian-correct result, which needs to be swapped to BGRA
+ gfx::SwizzleData(aDstARGB, aDstStrideARGB, gfx::SurfaceFormat::A8R8G8B8,
+ aDstARGB, aDstStrideARGB, gfx::SurfaceFormat::B8G8R8A8,
@@ -51,4 +73,4 @@
}
} // namespace gfx
-
+ } // namespace mozilla