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