[gtk+/rendering-cleanup] quartz: Convert default background drawing to cairo
- From: Kristian Rietveld <kristian src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/rendering-cleanup] quartz: Convert default background drawing to cairo
- Date: Sun, 8 Aug 2010 16:25:27 +0000 (UTC)
commit a636f0c38fa12839c2bd665ef4149438a8cd36f6
Author: Kristian Rietveld <kris gtk org>
Date: Sun Aug 8 18:02:04 2010 +0200
quartz: Convert default background drawing to cairo
gdk/quartz/gdkwindow-quartz.c | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c
index 2d0f8d9..387ff35 100644
--- a/gdk/quartz/gdkwindow-quartz.c
+++ b/gdk/quartz/gdkwindow-quartz.c
@@ -263,26 +263,26 @@ gdk_window_impl_quartz_begin_paint_region (GdkPaintable *paintable,
if (bg_pixmap == NULL)
{
- CGContextRef cg_context;
- CGColorRef color;
gint i;
+ cairo_t *cr;
+
+ cr = gdk_cairo_create (window);
+
+ gdk_cairo_set_source_color (cr, &private->bg_color);
+ cairo_translate (cr, -private->abs_x, -private->abs_y);
+
+ gdk_cairo_region (cr, clipped_and_offset_region);
+ cairo_clip (cr);
- cg_context = gdk_quartz_drawable_get_context (GDK_DRAWABLE (impl), FALSE);
- 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++)
{
cairo_rectangle_int_t rect;
cairo_region_get_rectangle (clipped_and_offset_region, i, &rect);
- CGContextFillRect (cg_context,
- CGRectMake (rect.x, rect.y,
- rect.width, rect.height));
+ gdk_cairo_rectangle (cr, &rect);
+ cairo_fill (cr);
}
- gdk_quartz_drawable_release_context (GDK_DRAWABLE (impl), cg_context);
+ cairo_destroy (cr);
}
else
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]