[test/meta-surface-pattern] Propagate errors.

Use cairo_get_target() to propagate any errors from the secondary context.
This commit is contained in:
Chris Wilson 2008-10-21 19:44:42 +01:00
parent 9d4262ebe0
commit b2cbbceb4c

View file

@ -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);