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