[test/source-clip-scale] Propagate error.

Use cairo_get_target() to propagate error from secondary context.
This commit is contained in:
Chris Wilson 2008-10-17 20:31:57 +01:00
parent 6cdbd132ce
commit 0f48cce8d9

View file

@ -48,6 +48,7 @@ draw (cairo_t *cr, int width, int height)
CAIRO_CONTENT_COLOR_ALPHA,
SIZE, SIZE);
cr2 = cairo_create (source);
cairo_surface_destroy (source);
/* Fill the source surface with green */
cairo_set_source_rgb (cr2, 0, 1, 0);
@ -74,11 +75,10 @@ draw (cairo_t *cr, int width, int height)
/* Now draw the source surface onto the destination with scaling. */
cairo_scale (cr, 2.0, 1.0);
cairo_set_source_surface (cr, source, 0, 0);
cairo_paint (cr);
cairo_set_source_surface (cr, cairo_get_target (cr2), 0, 0);
cairo_destroy (cr2);
cairo_surface_destroy (source);
cairo_paint (cr);
return CAIRO_TEST_SUCCESS;
}