[gtk+/wip/chergert/quartz-frame-clock: 212/228] wip: force colorspace to match private cairo patches



commit 2eaafaec24b80ac6b21cb3016b76e5c36c781050
Author: Christian Hergert <christian hergert me>
Date:   Mon Sep 7 01:51:58 2015 -0700

    wip: force colorspace to match private cairo patches

 gdk/quartz/gdkwindow-quartz.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c
index ee1a272..07493e2 100644
--- a/gdk/quartz/gdkwindow-quartz.c
+++ b/gdk/quartz/gdkwindow-quartz.c
@@ -3077,17 +3077,21 @@ gdk_root_window_impl_quartz_get_context (GdkWindowImplQuartz *window,
   CGColorSpaceRef colorspace;
   CGContextRef cg_context;
   GdkWindowImplQuartz *window_impl = GDK_WINDOW_IMPL_QUARTZ (window);
+  CMProfileRef prof;
 
   if (GDK_WINDOW_DESTROYED (window_impl->wrapper))
     return NULL;
 
+  CMGetSystemProfile (&prof);
+  colorspace = CGColorSpaceCreateWithPlatformColorSpace (prof);
+
   /* We do not have the notion of a root window on OS X.  We fake this
    * by creating a 1x1 bitmap and return a context to that.
    */
-  colorspace = CGColorSpaceCreateWithName (kCGColorSpaceGenericRGB);
   cg_context = CGBitmapContextCreate (NULL,
                                       1, 1, 8, 4, colorspace,
-                                      kCGImageAlphaPremultipliedLast);
+                                      kCGBitmapByteOrder32Host|kCGImageAlphaPremultipliedLast);
+
   CGColorSpaceRelease (colorspace);
 
   return cg_context;


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