external/skia/tdf147342.patch.0 |   21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

New commits:
commit 620ad1b7ae06d6f053fb2c9b57af96b736c04e57
Author:     PL <pluby@guibomacbookpro.local>
AuthorDate: Sat Jan 28 15:09:07 2023 -0500
Commit:     Patrick Luby <plub...@neooffice.org>
CommitDate: Sat Jan 28 22:26:48 2023 +0000

    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 <plub...@neooffice.org>

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;

Reply via email to