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