summarylogtreecommitdiffstats
path: root/0007-imported-patch-one_swizzle_to_rule_them_all.patch.patch
blob: fcd04a935ffcc2c7c59e414dd2c4a84d16090da1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "M. Sirringhaus" <msirringhaus@suse.de>
Date: Tue, 22 Feb 2022 09:24:46 +0100
Subject: [PATCH] imported patch one_swizzle_to_rule_them_all.patch

---
 gfx/webrender_bindings/RenderCompositorSWGL.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gfx/webrender_bindings/RenderCompositorSWGL.cpp b/gfx/webrender_bindings/RenderCompositorSWGL.cpp
index d767ff83f7718097e95883cbfdee31dea6cb198a..9146005c8b9dafee9ed0ea40ace3e71db9509e6d 100644
--- a/gfx/webrender_bindings/RenderCompositorSWGL.cpp
+++ b/gfx/webrender_bindings/RenderCompositorSWGL.cpp
@@ -7,6 +7,7 @@
 #include "RenderCompositorSWGL.h"
 
 #include "mozilla/gfx/Logging.h"
+#include "mozilla/gfx/Swizzle.h"
 #include "mozilla/widget/CompositorWidget.h"
 
 #ifdef MOZ_WIDGET_GTK
@@ -242,6 +243,13 @@ void RenderCompositorSWGL::CommitMappedBuffer(bool aDirty) {
   }
   mDT->Flush();
 
+#if MOZ_BIG_ENDIAN()
+  // One swizzle to rule them all.
+  gfx::SwizzleData(mMappedData, mMappedStride, gfx::SurfaceFormat::B8G8R8A8,
+                   mMappedData, mMappedStride, gfx::SurfaceFormat::A8R8G8B8,
+                   mDT->GetSize());
+#endif
+
   // Done with the DT. Hand it back to the widget and clear out any trace of it.
   mWidget->EndRemoteDrawingInRegion(mDT, mDirtyRegion);
   mDirtyRegion.SetEmpty();