Bug 681784 Colorspaces used in gtk+ and cairo quartz backends do not

match

Changes inspired by parafin <help@imtrappedininternet.com>
Replace colorspace creation calls to match those used by Cairo.
This commit is contained in:
John Ralls 2012-08-21 16:21:28 -07:00
parent fa98721182
commit 48547aadef
4 changed files with 6 additions and 6 deletions

View File

@ -237,7 +237,7 @@ _gdk_quartz_colormap_get_cgcolor_from_pixel (GdkDrawable *drawable,
else
components[3] = 1.0;
colorspace = CGColorSpaceCreateWithName (kCGColorSpaceGenericRGB);
colorspace = CGColorSpaceCreateDeviceRGB ();
color = CGColorCreate (colorspace, components);
CGColorSpaceRelease (colorspace);
break;

View File

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

View File

@ -684,7 +684,7 @@ _gdk_quartz_gc_update_cg_context (GdkGC *gc,
*/
info->drawable = drawable;
baseSpace = (fill == GDK_STIPPLED) ? CGColorSpaceCreateWithName (kCGColorSpaceGenericRGB) : NULL;
baseSpace = (fill == GDK_STIPPLED) ? CGColorSpaceCreateDeviceRGB () : NULL;
patternSpace = CGColorSpaceCreatePattern (baseSpace);
CGContextSetFillColorSpace (context, patternSpace);

View File

@ -65,7 +65,7 @@ gdk_pixmap_impl_quartz_get_image_parameters (GdkPixmap *pixmap,
*bytes_per_row = impl->width * 4;
if (colorspace)
*colorspace = CGColorSpaceCreateWithName (kCGColorSpaceGenericRGB);
*colorspace = CGColorSpaceCreateDeviceRGB ();
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 = CGColorSpaceCreateWithName (kCGColorSpaceGenericRGB);
*colorspace = CGColorSpaceCreateDeviceRGB ();
if (alpha_info)
*alpha_info = kCGImageAlphaPremultipliedFirst;