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