[test/smask-image-mask] Propagate error.

Use cairo_get_target() to propagate any error status from the secondary
context.
This commit is contained in:
Chris Wilson 2008-10-17 15:45:07 +01:00
parent 373d6c76b6
commit 9c0fe6c61e

View file

@ -46,10 +46,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);
@ -72,14 +76,10 @@ draw (cairo_t *cr, int width, int height)
cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT);
cairo_mask (cr2, pattern);
cairo_pattern_destroy (pattern);
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;
}