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