[gtk+/rendering-cleanup] style: Replace last gdk_draw_rectangle() with Cairo



commit 83fce1bd557bfc9a80e6cbf1b1d4549ecd18a9e2
Author: Benjamin Otte <otte redhat com>
Date:   Thu Jul 15 19:23:27 2010 +0200

    style: Replace last gdk_draw_rectangle() with Cairo

 gtk/gtkstyle.c |   21 +++++++++------------
 1 files changed, 9 insertions(+), 12 deletions(-)
---
diff --git a/gtk/gtkstyle.c b/gtk/gtkstyle.c
index 6af57d9..bfd5bbb 100644
--- a/gtk/gtkstyle.c
+++ b/gtk/gtkstyle.c
@@ -1525,18 +1525,15 @@ gtk_style_apply_default_background (GtkStyle          *style,
       GDK_IS_PIXMAP (window) ||
       (!set_bg && style->bg_pixmap[state_type] != (GdkPixmap*) GDK_PARENT_RELATIVE))
     {
-      GdkGC *gc = style->bg_gc[state_type];
-      
-      if (style->bg_pixmap[state_type])
-        {
-          gdk_gc_set_fill (gc, GDK_TILED);
-          gdk_gc_set_tile (gc, style->bg_pixmap[state_type]);
-        }
-      
-      gdk_draw_rectangle (window, gc, TRUE, 
-                          new_rect.x, new_rect.y, new_rect.width, new_rect.height);
-      if (style->bg_pixmap[state_type])
-        gdk_gc_set_fill (gc, GDK_SOLID);
+      cairo_t *cr = gdk_cairo_create (window);
+
+      gdk_cairo_set_source_pixmap (cr, style->bg_pixmap[state_type], 0, 0);
+      cairo_pattern_set_extend (cairo_get_source (cr), CAIRO_EXTEND_REPEAT);
+
+      gdk_cairo_rectangle (cr, &new_rect);
+      cairo_fill (cr);
+
+      cairo_destroy (cr);
     }
   else
     {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]