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