mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 13:28:03 +02:00
[test/smask-stroke] Propagate error.
Use cairo_get_target() to propagate the error from the secondary context.
This commit is contained in:
parent
546fbc2c0c
commit
b1e884cd89
1 changed files with 6 additions and 7 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue