]> Pileus Git - ~andy/gtk/commitdiff
Use cairo_push_group() to mix backgrounds during transitions
authorCarlos Garnacho <carlosg@gnome.org>
Sat, 5 Feb 2011 12:44:30 +0000 (13:44 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Sat, 5 Feb 2011 14:26:40 +0000 (15:26 +0100)
It also helps remove the cairo_clip() call to achieve the rounded
shape.

gtk/gtkthemingengine.c

index 1db600ef147fc348f416bc099a7eadb74bc7b3dd..a91daba8753546ee344fea9c8cea8d59b3732c65 100644 (file)
@@ -1498,10 +1498,8 @@ render_background_internal (GtkThemingEngine *engine,
                           NULL);
 
   running = gtk_theming_engine_state_is_running (engine, GTK_STATE_PRELIGHT, &progress);
-  _cairo_round_rectangle_sides (cr, (gdouble) radius,
-                                x, y, width, height,
-                                SIDE_ALL, junction);
-  cairo_clip (cr);
+
+  cairo_push_group (cr);
 
   if (gtk_theming_engine_has_class (engine, "background"))
     {
@@ -1711,6 +1709,14 @@ render_background_internal (GtkThemingEngine *engine,
       cairo_pattern_destroy (mask);
     }
 
+  cairo_pop_group_to_source (cr);
+
+  _cairo_round_rectangle_sides (cr, (gdouble) radius,
+                                x, y, width, height,
+                                SIDE_ALL, junction);
+  cairo_close_path (cr);
+  cairo_fill (cr);
+
   cairo_restore (cr);
 
   gdk_rgba_free (bg_color);