mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-02 18:58:14 +02:00
[test/smask-paint] Propagate error.
Use cairo_get_target() to propagate errors from the secondary context.
This commit is contained in:
parent
8bd6913282
commit
546fbc2c0c
1 changed files with 3 additions and 3 deletions
|
|
@ -45,6 +45,7 @@ draw (cairo_t *cr, int width, int height)
|
|||
CAIRO_CONTENT_ALPHA,
|
||||
width, height);
|
||||
cr2 = cairo_create (mask);
|
||||
cairo_surface_destroy (mask);
|
||||
|
||||
cairo_save (cr2); {
|
||||
cairo_set_operator (cr2, CAIRO_OPERATOR_CLEAR);
|
||||
|
|
@ -61,7 +62,6 @@ draw (cairo_t *cr, int width, int height)
|
|||
cairo_pattern_destroy (pattern);
|
||||
|
||||
cairo_paint (cr2);
|
||||
cairo_destroy (cr2);
|
||||
|
||||
cairo_set_source_rgb (cr, 0, 0, 1.0);
|
||||
cairo_paint (cr);
|
||||
|
|
@ -76,8 +76,8 @@ draw (cairo_t *cr, int width, int height)
|
|||
cairo_set_source (cr, pattern);
|
||||
cairo_pattern_destroy (pattern);
|
||||
|
||||
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