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