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