229cbf
# HG changeset patch
229cbf
# User M. Sirringhaus <msirringhaus@suse.de>
229cbf
# Date 1645518286 -3600
229cbf
#      Tue Feb 22 09:24:46 2022 +0100
229cbf
# Node ID 494640792b4677f6462e95b90a54a4e22aeb738b
229cbf
# Parent  81832d035e101471dcf52dd91de287268add7a91
229cbf
imported patch one_swizzle_to_rule_them_all.patch
229cbf
229cbf
Index: firefox-102.0/gfx/webrender_bindings/RenderCompositorSWGL.cpp
229cbf
===================================================================
229cbf
--- firefox-102.0.orig/gfx/webrender_bindings/RenderCompositorSWGL.cpp
229cbf
+++ firefox-102.0/gfx/webrender_bindings/RenderCompositorSWGL.cpp
229cbf
@@ -7,6 +7,7 @@
229cbf
 #include "RenderCompositorSWGL.h"
229cbf
 
229cbf
 #include "mozilla/gfx/Logging.h"
229cbf
+#include "mozilla/gfx/Swizzle.h"
229cbf
 #include "mozilla/widget/CompositorWidget.h"
229cbf
 
229cbf
 #ifdef MOZ_WIDGET_GTK
229cbf
@@ -235,6 +237,13 @@ void RenderCompositorSWGL::CommitMappedB
229cbf
   }
229cbf
   mDT->Flush();
229cbf
 
229cbf
+#if MOZ_BIG_ENDIAN()
229cbf
+  // One swizzle to rule them all.
229cbf
+  gfx::SwizzleData(mMappedData, mMappedStride, gfx::SurfaceFormat::B8G8R8A8,
229cbf
+                   mMappedData, mMappedStride, gfx::SurfaceFormat::A8R8G8B8,
229cbf
+                   mDT->GetSize());
229cbf
+#endif
229cbf
+
229cbf
   // Done with the DT. Hand it back to the widget and clear out any trace of it.
229cbf
   mWidget->EndRemoteDrawingInRegion(mDT, mDirtyRegion);
229cbf
   mDirtyRegion.SetEmpty();