summaryrefslogtreecommitdiff
path: root/test/smask-stroke.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2008-10-17 15:52:55 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2008-10-18 09:55:07 +0100
commitb1e884cd89ab2b83d3b8e072414e4e3f63e3a023 (patch)
treebdf9f845e4ab237091c1754b619cf4419cde1b8d /test/smask-stroke.c
parent546fbc2c0cf87abd627477056bf19063c5aa001a (diff)
downloadcairo-b1e884cd89ab2b83d3b8e072414e4e3f63e3a023.tar.gz
[test/smask-stroke] Propagate error.
Use cairo_get_target() to propagate the error from the secondary context.
Diffstat (limited to 'test/smask-stroke.c')
-rw-r--r--test/smask-stroke.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/test/smask-stroke.c b/test/smask-stroke.c
index fa0afd60f..88fc9f0f9 100644
--- a/test/smask-stroke.c
+++ b/test/smask-stroke.c
@@ -41,10 +41,14 @@ draw (cairo_t *cr, int width, int height)
cairo_pattern_t *pattern;
cairo_t *cr2;
+ cairo_set_source_rgb (cr, 0, 0, 1.0);
+ cairo_paint (cr);
+
mask = cairo_surface_create_similar (cairo_get_group_target (cr),
CAIRO_CONTENT_ALPHA,
width, height);
cr2 = cairo_create (mask);
+ cairo_surface_destroy (mask);
cairo_save (cr2); {
cairo_set_operator (cr2, CAIRO_OPERATOR_CLEAR);
@@ -62,15 +66,10 @@ draw (cairo_t *cr, int width, int height)
cairo_arc (cr2, 0.5 * width, 0.5 * height, 0.4 * height, 0, 2 * M_PI);
cairo_stroke (cr2);
- cairo_destroy (cr2);
-
-
- cairo_set_source_rgb (cr, 0, 0, 1.0);
- cairo_paint (cr);
cairo_set_source_rgb (cr, 1.0, 0, 0);
- cairo_mask_surface (cr, mask, 0, 0);
- cairo_surface_destroy (mask);
+ cairo_mask_surface (cr, cairo_get_target (cr2), 0, 0);
+ cairo_destroy (cr2);
return CAIRO_TEST_SUCCESS;
}