Rework color translation to support gray scale and bitmaps

(cherry picked from commit 49f72c1fb4bf90fde0ba9c4b40794672b775d2a8)
This commit is contained in:
Kristian Rietveld
2010-06-26 17:08:15 +02:00
parent 18b233fe2a
commit 88cae1769b
4 changed files with 115 additions and 59 deletions

View File

@ -262,14 +262,14 @@ gdk_window_impl_quartz_begin_paint_region (GdkPaintable *paintable,
if (bg_pixmap == NULL)
{
CGContextRef cg_context;
CGFloat r, g, b, a;
CGColorRef color;
gint i;
cg_context = gdk_quartz_drawable_get_context (GDK_DRAWABLE (impl), FALSE);
_gdk_quartz_colormap_get_rgba_from_pixel (gdk_drawable_get_colormap (window),
private->bg_color.pixel,
&r, &g, &b, &a);
CGContextSetRGBFillColor (cg_context, r, g, b, a);
color = _gdk_quartz_colormap_get_cgcolor_from_pixel (window,
private->bg_color.pixel);
CGContextSetFillColorWithColor (cg_context, color);
CGColorRelease (color);
for (i = 0; i < n_rects; i++)
{