From d07913840aca3ba3ef2cd046082f49da7fca39d7 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Wed, 8 Jan 2014 10:44:32 +0100 Subject: PixelCache: Ensure clean cairo_t state in draw This adds save/restore calls to the clear-to-transparent call in the pixel cache, to avoid changing the default color of the cairo_t. It also removes a call set_operator call that is no longer necessary (it was trying to manually restore the state). https://bugzilla.gnome.org/show_bug.cgi?id=721480 --- gtk/gtkpixelcache.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gtk/gtkpixelcache.c') diff --git a/gtk/gtkpixelcache.c b/gtk/gtkpixelcache.c index 411a75e7c3..71c78330d8 100644 --- a/gtk/gtkpixelcache.c +++ b/gtk/gtkpixelcache.c @@ -340,12 +340,13 @@ _gtk_pixel_cache_repaint (GtkPixelCache *cache, cairo_translate (backing_cr, -cache->surface_x - canvas_rect->x - view_rect->x, -cache->surface_y - canvas_rect->y - view_rect->y); + + cairo_save (backing_cr); cairo_set_source_rgba (backing_cr, 0.0, 0, 0, 0.0); cairo_set_operator (backing_cr, CAIRO_OPERATOR_SOURCE); cairo_paint (backing_cr); - - cairo_set_operator (backing_cr, CAIRO_OPERATOR_OVER); + cairo_restore (backing_cr); cairo_save (backing_cr); draw (backing_cr, user_data); -- cgit v1.2.1