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