2019-09-25 17:13:22 +02:00
|
|
|
# HG changeset patch
|
2023-08-31 09:59:41 +02:00
|
|
|
# Parent 9fcbd287056a40084b1e679f787bf683b291f323
|
2019-09-25 17:13:22 +02:00
|
|
|
Taken from https://bugzilla.mozilla.org/show_bug.cgi?id=1504834
|
|
|
|
|
2020-09-25 08:32:50 +02:00
|
|
|
diff --git a/gfx/2d/DrawTargetSkia.cpp b/gfx/2d/DrawTargetSkia.cpp
|
|
|
|
--- a/gfx/2d/DrawTargetSkia.cpp
|
|
|
|
+++ b/gfx/2d/DrawTargetSkia.cpp
|
2023-08-31 09:59:41 +02:00
|
|
|
@@ -156,7 +156,8 @@ static IntRect CalculateSurfaceBounds(co
|
2019-09-25 17:13:22 +02:00
|
|
|
}
|
|
|
|
|
2023-08-31 09:59:41 +02:00
|
|
|
static const int kARGBAlphaOffset =
|
2019-09-25 17:13:22 +02:00
|
|
|
- SurfaceFormat::A8R8G8B8_UINT32 == SurfaceFormat::B8G8R8A8 ? 3 : 0;
|
2023-08-31 09:59:41 +02:00
|
|
|
+ 0; // Skia is always BGRA SurfaceFormat::A8R8G8B8_UINT32 ==
|
|
|
|
+ // SurfaceFormat::B8G8R8A8 ? 3 : 0;
|
2019-09-25 17:13:22 +02:00
|
|
|
|
|
|
|
static bool VerifyRGBXFormat(uint8_t* aData, const IntSize& aSize,
|
|
|
|
const int32_t aStride, SurfaceFormat aFormat) {
|
2020-09-25 08:32:50 +02:00
|
|
|
diff --git a/gfx/2d/Types.h b/gfx/2d/Types.h
|
|
|
|
--- a/gfx/2d/Types.h
|
|
|
|
+++ b/gfx/2d/Types.h
|
2023-08-31 09:59:41 +02:00
|
|
|
@@ -89,18 +89,11 @@ enum class SurfaceFormat : int8_t {
|
2020-09-25 08:32:50 +02:00
|
|
|
// This represents the unknown format.
|
2023-08-31 09:59:41 +02:00
|
|
|
UNKNOWN, // TODO: Replace uses with Maybe<SurfaceFormat>.
|
2020-09-25 08:32:50 +02:00
|
|
|
|
2023-08-31 09:59:41 +02:00
|
|
|
-// The following values are endian-independent synonyms. The _UINT32 suffix
|
|
|
|
-// indicates that the name reflects the layout when viewed as a uint32_t
|
|
|
|
-// value.
|
2020-09-25 08:32:50 +02:00
|
|
|
-#if MOZ_LITTLE_ENDIAN()
|
2023-08-31 09:59:41 +02:00
|
|
|
+ // The following values are endian-independent synonyms. The _UINT32 suffix
|
|
|
|
+ // indicates that the name reflects the layout when viewed as a uint32_t
|
|
|
|
+ // value.
|
2019-09-25 17:13:22 +02:00
|
|
|
A8R8G8B8_UINT32 = B8G8R8A8, // 0xAARRGGBB
|
2020-09-25 08:32:50 +02:00
|
|
|
X8R8G8B8_UINT32 = B8G8R8X8, // 0x00RRGGBB
|
|
|
|
-#elif MOZ_BIG_ENDIAN()
|
2019-09-25 17:13:22 +02:00
|
|
|
- A8R8G8B8_UINT32 = A8R8G8B8, // 0xAARRGGBB
|
2020-09-25 08:32:50 +02:00
|
|
|
- X8R8G8B8_UINT32 = X8R8G8B8, // 0x00RRGGBB
|
2019-09-25 17:13:22 +02:00
|
|
|
-#else
|
|
|
|
-# error "bad endianness"
|
|
|
|
-#endif
|
|
|
|
|
2020-09-25 08:32:50 +02:00
|
|
|
// The following values are OS and endian-independent synonyms.
|
|
|
|
//
|
2023-08-31 09:59:41 +02:00
|
|
|
diff --git a/gfx/skia/skia/modules/skcms/skcms.cc b/gfx/skia/skia/modules/skcms/skcms.cc
|
|
|
|
--- a/gfx/skia/skia/modules/skcms/skcms.cc
|
|
|
|
+++ b/gfx/skia/skia/modules/skcms/skcms.cc
|
|
|
|
@@ -30,6 +30,8 @@
|
2020-09-25 08:32:50 +02:00
|
|
|
#include <avx512fintrin.h>
|
|
|
|
#include <avx512dqintrin.h>
|
|
|
|
#endif
|
2019-09-25 17:13:22 +02:00
|
|
|
+#else
|
|
|
|
+ #define SKCMS_PORTABLE
|
|
|
|
#endif
|
|
|
|
|
2023-08-31 09:59:41 +02:00
|
|
|
static bool runtime_cpu_detection = true;
|
|
|
|
@@ -324,20 +326,28 @@ enum {
|
2019-09-25 17:13:22 +02:00
|
|
|
static uint16_t read_big_u16(const uint8_t* ptr) {
|
|
|
|
uint16_t be;
|
|
|
|
memcpy(&be, ptr, sizeof(be));
|
|
|
|
-#if defined(_MSC_VER)
|
2023-08-31 09:59:41 +02:00
|
|
|
- return _byteswap_ushort(be);
|
2019-09-25 17:13:22 +02:00
|
|
|
+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
|
|
|
|
+ return be;
|
2023-08-31 09:59:41 +02:00
|
|
|
#else
|
|
|
|
- return __builtin_bswap16(be);
|
2019-09-25 17:13:22 +02:00
|
|
|
+ #if defined(_MSC_VER)
|
2023-08-31 09:59:41 +02:00
|
|
|
+ return _byteswap_ushort(be);
|
2019-09-25 17:13:22 +02:00
|
|
|
+ #else
|
2023-08-31 09:59:41 +02:00
|
|
|
+ return __builtin_bswap16(be);
|
2019-09-25 17:13:22 +02:00
|
|
|
+ #endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
static uint32_t read_big_u32(const uint8_t* ptr) {
|
|
|
|
uint32_t be;
|
|
|
|
memcpy(&be, ptr, sizeof(be));
|
|
|
|
-#if defined(_MSC_VER)
|
2023-08-31 09:59:41 +02:00
|
|
|
- return _byteswap_ulong(be);
|
2019-09-25 17:13:22 +02:00
|
|
|
+#if __BYTE_ORDER == __ORDER_BIG_ENDIAN__
|
|
|
|
+ return be;
|
2023-08-31 09:59:41 +02:00
|
|
|
#else
|
|
|
|
- return __builtin_bswap32(be);
|
2019-09-25 17:13:22 +02:00
|
|
|
+ #if defined(_MSC_VER)
|
2023-08-31 09:59:41 +02:00
|
|
|
+ return _byteswap_ulong(be);
|
2019-09-25 17:13:22 +02:00
|
|
|
+ #else
|
2023-08-31 09:59:41 +02:00
|
|
|
+ return __builtin_bswap32(be);
|
2019-09-25 17:13:22 +02:00
|
|
|
+ #endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|