diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2008-10-17 15:43:26 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2008-10-18 09:55:06 +0100 |
commit | 373d6c76b65e826f81873b51461bdf3c30024c06 (patch) | |
tree | efe435f46f828a88b223f2d5961894291957ef66 | |
parent | bb05beaab626d2fca6d219bfd8148dde71073b39 (diff) | |
download | cairo-373d6c76b65e826f81873b51461bdf3c30024c06.tar.gz |
[test/smask-fill] Propagate error status.
Use cairo_get_target() to propagate the error from the secondary context.
-rw-r--r-- | test/smask-fill.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/test/smask-fill.c b/test/smask-fill.c index 66f8b0dc1..58d32c1ac 100644 --- a/test/smask-fill.c +++ b/test/smask-fill.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.45 * height, 0, 2 * M_PI); cairo_fill (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; } |