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