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