[gtk] Use [NSGraphicsContext CGContext] instead of graphicsPort after Yosemite.



commit e457a7823cf9576eba7fea2364db1a7ceb676d3f
Author: John Ralls <jralls ceridwen us>
Date:   Mon Oct 15 10:45:57 2018 -0700

    Use [NSGraphicsContext CGContext] instead of graphicsPort after Yosemite.

 gdk/quartz/gdksurface-quartz.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gdk/quartz/gdksurface-quartz.c b/gdk/quartz/gdksurface-quartz.c
index c635a6386a..ff7c62a688 100644
--- a/gdk/quartz/gdksurface-quartz.c
+++ b/gdk/quartz/gdksurface-quartz.c
@@ -134,8 +134,10 @@ gdk_surface_impl_quartz_get_context (GdkSurfaceImplQuartz *surface_impl,
       if (![surface_impl->view lockFocusIfCanDraw])
         return NULL;
     }
-
-  cg_context = [[NSGraphicsContext currentContext] graphicsPort];
+  if (gdk_quartz_osx_version () < GDK_OSX_YOSEMITE)
+       cg_context = [[NSGraphicsContext currentContext] graphicsPort];
+  else
+       cg_context = [[NSGraphicsContext currentContext] CGContext];
   CGContextSaveGState (cg_context);
   CGContextSetAllowsAntialiasing (cg_context, antialias);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]