diff options
author | Alexander Larsson <alexl@redhat.com> | 2014-01-08 10:44:32 +0100 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2014-01-08 10:48:56 +0100 |
commit | d07913840aca3ba3ef2cd046082f49da7fca39d7 (patch) | |
tree | 80a2ccc12fc318e3c7a1ef628f7631fae59c62f9 /gtk/gtkpixelcache.c | |
parent | 256561db2f0b34e01047f8882b3e0cb8c6d9dbab (diff) | |
download | gtk+-d07913840aca3ba3ef2cd046082f49da7fca39d7.tar.gz |
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
Diffstat (limited to 'gtk/gtkpixelcache.c')
-rw-r--r-- | gtk/gtkpixelcache.c | 5 |
1 files changed, 3 insertions, 2 deletions
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); |