summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Hergert <chergert@redhat.com>2022-02-05 12:42:57 -0800
committerChristian Hergert <chergert@redhat.com>2022-02-05 12:42:57 -0800
commit95168e179cd216f0742e3ba4289befa8db663c59 (patch)
tree14bd3e96a88044adb02fd5dc705b83b7ca295604
parent2be51dc3b11a5d8dadb648efe033074becc8f0a4 (diff)
downloadgtk+-95168e179cd216f0742e3ba4289befa8db663c59.tar.gz
macos: fallback to conversion on WCG colorspace
We don't want to risk having something really weird come out if we have a WCG colorspace, so instead only do the performance hack on systems where the output is likely reasonable. We will want to eventually just be drawing in the appropriate colorspace, but that is not available yet.
-rw-r--r--gdk/macos/GdkMacosCairoView.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gdk/macos/GdkMacosCairoView.c b/gdk/macos/GdkMacosCairoView.c
index ad8c72f649..6596702fe8 100644
--- a/gdk/macos/GdkMacosCairoView.c
+++ b/gdk/macos/GdkMacosCairoView.c
@@ -97,6 +97,15 @@ release_surface_provider (void *info,
monitor = _gdk_macos_surface_get_best_monitor ([self gdkSurface]);
rgb = _gdk_macos_monitor_copy_colorspace (GDK_MACOS_MONITOR (monitor));
+ /* If we have an WCG colorspace, just take the slow path or we risk
+ * really screwing things up.
+ */
+ if (CGColorSpaceIsWideGamutRGB (rgb))
+ {
+ CGColorSpaceRelease (rgb);
+ rgb = CGColorSpaceCreateDeviceRGB ();
+ }
+
/* Assert that our image surface was created correctly with
* 16-byte aligned pointers and strides. This is needed to
* ensure that we're working with fast paths in CoreGraphics.