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