blob: 9af479855e6d16b6ffdd50a644ed05e18bfb8cc5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "M. Sirringhaus" <msirringhaus@suse.de>
Date: Tue, 22 Feb 2022 09:24:46 +0100
Subject: [PATCH] imported patch svg-rendering.patch
---
image/imgFrame.cpp | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/image/imgFrame.cpp b/image/imgFrame.cpp
index 0df40fcfa93c6c33ab4440427e6471860ab2f247..42881901004a6106f7402eb08b4af09296540654 100644
--- a/image/imgFrame.cpp
+++ b/image/imgFrame.cpp
@@ -372,6 +372,17 @@ nsresult imgFrame::InitWithDrawable(gfxDrawable* aDrawable,
return NS_ERROR_OUT_OF_MEMORY;
}
+#if MOZ_BIG_ENDIAN()
+ if (aBackend == gfx::BackendType::SKIA && canUseDataSurface) {
+ // SKIA is lying about what format it returns on big endian
+ for (int ii=0; ii < mRawSurface->GetSize().Height()*mRawSurface->Stride() / 4; ++ii) {
+ uint32_t *vals = (uint32_t*)(mRawSurface->GetData());
+ uint32_t val = ((vals[ii] << 8) & 0xFF00FF00 ) | ((vals[ii] >> 8) & 0xFF00FF );
+ vals[ii] = (val << 16) | (val >> 16);
+ }
+ }
+#endif
+
if (!canUseDataSurface) {
// We used an offscreen surface, which is an "optimized" surface from
// imgFrame's perspective.
|