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