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