quartz: Always use generic color space

Switch all usage of device color spaces to generic color spaces.  Since
the former color spaces are no longer device-dependent as of Mac OS X
10.4, these yielded a very costly color space conversion when drawing
pixmaps to the screen.  We now avoid this by using the generic color
space.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=624025
This commit is contained in:
Kristian Rietveld 2010-10-19 00:55:52 +02:00
parent e6e9eef855
commit f62b56194b
2 changed files with 5 additions and 5 deletions

View File

@ -565,7 +565,7 @@ gdk_quartz_draw_pixbuf (GdkDrawable *drawable,
data = gdk_pixbuf_get_pixels (pixbuf);
colorspace = CGColorSpaceCreateDeviceRGB ();
colorspace = CGColorSpaceCreateWithName (kCGColorSpaceGenericRGB);
data_provider = CGDataProviderCreateWithData (NULL, data, pixbuf_height * rowstride, NULL);
image = CGImageCreate (pixbuf_width, pixbuf_height, 8,
@ -610,7 +610,7 @@ gdk_quartz_draw_image (GdkDrawable *drawable,
if (!context)
return;
colorspace = CGColorSpaceCreateDeviceRGB ();
colorspace = CGColorSpaceCreateWithName (kCGColorSpaceGenericRGB);
data_provider = CGDataProviderCreateWithData (NULL, image->mem, image->height * image->bpl, NULL);
/* FIXME: Make sure that this function draws 32-bit images correctly,

View File

@ -65,7 +65,7 @@ gdk_pixmap_impl_quartz_get_image_parameters (GdkPixmap *pixmap,
*bytes_per_row = impl->width * 4;
if (colorspace)
*colorspace = CGColorSpaceCreateDeviceRGB ();
*colorspace = CGColorSpaceCreateWithName (kCGColorSpaceGenericRGB);
if (alpha_info)
*alpha_info = kCGImageAlphaNoneSkipLast;
@ -82,7 +82,7 @@ gdk_pixmap_impl_quartz_get_image_parameters (GdkPixmap *pixmap,
*bytes_per_row = impl->width * 4;
if (colorspace)
*colorspace = CGColorSpaceCreateDeviceRGB ();
*colorspace = CGColorSpaceCreateWithName (kCGColorSpaceGenericRGB);
if (alpha_info)
*alpha_info = kCGImageAlphaPremultipliedFirst;
@ -99,7 +99,7 @@ gdk_pixmap_impl_quartz_get_image_parameters (GdkPixmap *pixmap,
*bytes_per_row = impl->width;
if (colorspace)
*colorspace = CGColorSpaceCreateDeviceGray ();
*colorspace = CGColorSpaceCreateWithName (kCGColorSpaceGenericGray);
if (alpha_info)
*alpha_info = kCGImageAlphaNone;