From 312e5781f36e2014dc79ac4a82bea4f7fb57d9da Mon Sep 17 00:00:00 2001 From: John Ralls Date: Sat, 11 Feb 2023 12:48:34 -0800 Subject: [PATCH] [quartz] Set the sRGB colorspace on the IOSurface. Enables colorspace tranformation in Core Animation. This transform is executed on the GPU and unlike the Core Graphics one has no affect on performance. Fixes #5579 --- gdk/quartz/GdkQuartzView.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gdk/quartz/GdkQuartzView.c b/gdk/quartz/GdkQuartzView.c index 81c2d32007..f8c53841f3 100644 --- a/gdk/quartz/GdkQuartzView.c +++ b/gdk/quartz/GdkQuartzView.c @@ -548,6 +548,8 @@ copy_rectangle_argb32 (cairo_surface_t *dest, cairo_surface_t *source, -(void)createBackingStoreWithWidth: (CGFloat) width andHeight: (CGFloat) height { + IOSurfaceRef surface; + g_return_if_fail (width && height); CVPixelBufferRelease (pixels); @@ -555,6 +557,9 @@ copy_rectangle_argb32 (cairo_surface_t *dest, cairo_surface_t *source, kCVPixelFormatType_32BGRA, cfpb_props, &pixels); + surface = CVPixelBufferGetIOSurface (pixels); + IOSurfaceSetValue(surface, CFSTR("IOSurfaceColorSpace"), + kCGColorSpaceSRGB); } #if MAC_OS_X_VERSION_MIN_REQUIRED >= 10700