summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2008-10-21 11:22:48 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2008-10-21 11:31:12 +0100
commit5a822046cc66d8405618370c1071433016969020 (patch)
tree82d3468840c579bc7ddce6d00ba4482f278ae0be
parent21223cc12ca00c52c0b39dc60db410f29e4e76c9 (diff)
[test/xlib-expose-event] Propagate errors.
Use cairo_get_target() to propagate errors from secondary contexts.
-rw-r--r--test/xlib-expose-event.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/test/xlib-expose-event.c b/test/xlib-expose-event.c
index 189b8f1f9..2d2a6c1ba 100644
--- a/test/xlib-expose-event.c
+++ b/test/xlib-expose-event.c
@@ -85,6 +85,7 @@ draw_mask (cairo_t *cr)
cairo_boilerplate_xlib_surface_disable_render (surface);
cr2 = cairo_create (surface);
+ cairo_surface_destroy (surface);
/* This complex clip and forcing of fallbacks is to reproduce bug
* http://bugs.freedesktop.org/show_bug.cgi?id=10921
@@ -103,11 +104,10 @@ draw_mask (cairo_t *cr)
cairo_line_to (cr2, 25, 50);
cairo_set_source_rgb (cr2, 1, 1, 1);
cairo_stroke (cr2);
- cairo_destroy (cr2);
cairo_set_source_rgb (cr, 1, 0, 0);
- cairo_mask_surface (cr, surface, 50, 50);
- cairo_surface_destroy (surface);
+ cairo_mask_surface (cr, cairo_get_target (cr2), 50, 50);
+ cairo_destroy (cr2);
}
static cairo_surface_t *
@@ -122,9 +122,13 @@ clone_similar_surface (cairo_surface_t * target, cairo_surface_t *surface)
cairo_image_surface_get_height (surface));
cr = cairo_create (similar);
+ cairo_surface_destroy (similar);
+
cairo_set_source_surface (cr, surface, 0, 0);
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
cairo_paint (cr);
+
+ similar = cairo_surface_reference (cairo_get_target (cr));
cairo_destroy (cr);
return similar;