summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;