quartz: use CGContext accessor on Yosemite and newer

Based on part of the MacPorts Big Sur performance patch for GIMP issue 5989.

Use the modern NSGraphicsContext CGContext accessor on Yosemite and newer, matching the existing Quartz window code, while preserving graphicsPort for older macOS versions.
This commit is contained in:
Daemonratte 2026-05-13 09:32:30 +02:00
commit 21fdf2eeaa

View file

@ -67,7 +67,10 @@ _gtk_quartz_create_image_from_pixbuf (GdkPixbuf *pixbuf)
}
[nsimage lockFocus];
context = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
if (gdk_quartz_osx_version () < GDK_OSX_YOSEMITE)
context = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
else
context = [[NSGraphicsContext currentContext] CGContext];
CGContextDrawImage (context, CGRectMake (0, 0, pixbuf_width, pixbuf_height), image);
[nsimage unlockFocus];