mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 06:28:01 +02:00
[test/meta-surface-pattern] Propagate errors.
Use cairo_get_target() to propagate any errors from the secondary context.
This commit is contained in:
parent
9d4262ebe0
commit
b2cbbceb4c
1 changed files with 2 additions and 3 deletions
|
|
@ -60,8 +60,8 @@ draw (cairo_t *cr, int width, int height)
|
|||
pat_surface = cairo_surface_create_similar (cairo_get_group_target (cr),
|
||||
CAIRO_CONTENT_COLOR_ALPHA,
|
||||
PAT_WIDTH, PAT_HEIGHT);
|
||||
|
||||
cr2 = cairo_create (pat_surface);
|
||||
cairo_surface_destroy (pat_surface);
|
||||
|
||||
cairo_set_source_rgba (cr2, 1, 0, 1, 0.5);
|
||||
cairo_rectangle (cr2, PAT_WIDTH/6.0, PAT_HEIGHT/6.0, PAT_WIDTH/4.0, PAT_HEIGHT/4.0);
|
||||
|
|
@ -104,9 +104,8 @@ draw (cairo_t *cr, int width, int height)
|
|||
cairo_line_to (cr2, PAT_WIDTH/4.0, PAT_WIDTH);
|
||||
cairo_stroke (cr2);
|
||||
|
||||
pattern = cairo_pattern_create_for_surface (cairo_get_target (cr2));
|
||||
cairo_destroy (cr2);
|
||||
pattern = cairo_pattern_create_for_surface (pat_surface);
|
||||
cairo_surface_destroy (pat_surface);
|
||||
|
||||
cairo_matrix_init_identity (&mat);
|
||||
cairo_matrix_scale (&mat, 2, 1.5);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue