mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-18 09:00:34 +00:00
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:
parent
fa98721182
commit
48547aadef
@ -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;
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user