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