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