d2e479
# HG changeset patch
d2e479
# User M. Sirringhaus <msirringhaus@suse.de>
d2e479
# Date 1645518286 -3600
d2e479
#      Tue Feb 22 09:24:46 2022 +0100
d2e479
# Node ID 81832d035e101471dcf52dd91de287268add7a91
d2e479
# Parent  66f7ce16eb4965108687280e5443edd610631efb
d2e479
imported patch svg-rendering.patch
d2e479
d2e479
diff --git a/image/imgFrame.cpp b/image/imgFrame.cpp
d2e479
--- a/image/imgFrame.cpp
d2e479
+++ b/image/imgFrame.cpp
d2e479
@@ -372,6 +372,17 @@ nsresult imgFrame::InitWithDrawable(gfxD
d2e479
     return NS_ERROR_OUT_OF_MEMORY;
d2e479
   }
d2e479
 
d2e479
+#if MOZ_BIG_ENDIAN()
d2e479
+  if (aBackend == gfx::BackendType::SKIA && canUseDataSurface) {
d2e479
+      // SKIA is lying about what format it returns on big endian
d2e479
+      for (int ii=0; ii < mRawSurface->GetSize().Height()*mRawSurface->Stride() / 4; ++ii) {
d2e479
+        uint32_t *vals = (uint32_t*)(mRawSurface->GetData());
d2e479
+        uint32_t val = ((vals[ii] << 8) & 0xFF00FF00 ) | ((vals[ii] >> 8) & 0xFF00FF );
d2e479
+        vals[ii] = (val << 16) | (val >> 16);
d2e479
+      }
d2e479
+  }
d2e479
+#endif
d2e479
+
d2e479
   if (!canUseDataSurface) {
d2e479
     // We used an offscreen surface, which is an "optimized" surface from
d2e479
     // imgFrame's perspective.