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