summaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorPL <pluby@guibomacbookpro.local>2023-01-28 15:09:07 -0500
committerPatrick Luby <plubius@neooffice.org>2023-01-28 22:26:48 +0000
commit620ad1b7ae06d6f053fb2c9b57af96b736c04e57 (patch)
treee9dc49f42fe20ca372c78ae4231c810aeae472f7 /external
parent0e09fff5f89b38245b108edb67d5e75e57774874 (diff)
Related: tdf#145988 Reset layer's pixel format to MTLPixelFormatBGRA8Unorm
Skia initally sets the layer's pixel format to be BGRA8888 but macOS may change the layer's pixel format when a window has moved to a screen with 30-bit color depth so reset it back to BGRA8888. Change-Id: I1ad47a31e41aaa197e3052146243882e0b4ef673 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146301 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org>
Diffstat (limited to 'external')
-rw-r--r--external/skia/tdf147342.patch.021
1 files changed, 18 insertions, 3 deletions
diff --git a/external/skia/tdf147342.patch.0 b/external/skia/tdf147342.patch.0
index 72ec8adf9a46..3b50038c07ac 100644
--- a/external/skia/tdf147342.patch.0
+++ b/external/skia/tdf147342.patch.0
@@ -19,16 +19,31 @@
namespace window_context_factory {
--- tools/sk_app/mac/MetalWindowContext_mac.mm 2021-11-25 10:39:27.000000000 -0500
-+++ tools/sk_app/mac/MetalWindowContext_mac.mm 2023-01-25 08:20:32.000000000 -0500
-@@ -87,6 +91,12 @@
++++ tools/sk_app/mac/MetalWindowContext_mac.mm 2023-01-28 14:55:57.000000000 -0500
+@@ -11,6 +11,8 @@
+ #import <Cocoa/Cocoa.h>
+ #import <QuartzCore/CAConstraintLayoutManager.h>
+
++#include <sal/log.hxx>
++
+ using sk_app::DisplayParams;
+ using sk_app::window_context_factory::MacWindowInfo;
+ using sk_app::MetalWindowContext;
+@@ -87,6 +89,18 @@
fMetalLayer.drawableSize = backingSize;
fMetalLayer.contentsScale = backingScaleFactor;
-+ // Related tdf#147342 Copy layer's colorspace to window's colorspace
++ // Related: tdf#147342 Copy layer's colorspace to window's colorspace
+ // This method is now called when the window's backing properties have
+ // changed so copy any colorspace changes.
+ NSColorSpace* cs = fMainView.window.colorSpace;
+ fMetalLayer.colorspace = cs.CGColorSpace;
++ // Related tdf#145988 Reset layer's pixel format to MTLPixelFormatBGRA8Unorm
++ // Skia initally sets the layer's pixel format to be BGRA8888 but macOS
++ // may change the layer's pixel format when a window has moved to a screen
++ // with 30-bit color depth so reset it back to BGRA8888.
++ SAL_WARN_IF(fMetalLayer.pixelFormat != MTLPixelFormatBGRA8Unorm, "vcl.skia.metal", "CAMetalLayer pixel format is " << fMetalLayer.pixelFormat << " but should be " << MTLPixelFormatBGRA8Unorm << " (MTLPixelFormatBGRA8Unorm)");
++ fMetalLayer.pixelFormat = MTLPixelFormatBGRA8Unorm;
+
fWidth = backingSize.width;
fHeight = backingSize.height;