From b5551cfce2969358746dadae90cbe1add012e29c Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 21 Oct 2008 11:19:40 +0100 Subject: [PATCH] [test/rotate-image-surface-paint] Proapgate errors. Use cairo_get_target() to propagate errors from the secondary context. --- test/rotate-image-surface-paint.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/rotate-image-surface-paint.c b/test/rotate-image-surface-paint.c index 25ce9c558..f1e9e4f51 100644 --- a/test/rotate-image-surface-paint.c +++ b/test/rotate-image-surface-paint.c @@ -51,6 +51,8 @@ draw (cairo_t *cr, int width, int height) surface = cairo_image_surface_create (CAIRO_FORMAT_RGB24, surface_size, surface_size); cr_surface = cairo_create (surface); + cairo_surface_destroy (surface); + cairo_set_source_rgb (cr_surface, 1, 1, 1); cairo_rectangle (cr_surface, 0, 0, @@ -71,7 +73,6 @@ draw (cairo_t *cr, int width, int height) surface_size / 2, surface_size / 2, surface_size / 2, surface_size / 2); cairo_fill (cr_surface); - cairo_destroy (cr_surface); /* First paint opaque background (black) so we don't need separate * ARGB32 and RGB24 reference images. */ @@ -82,11 +83,11 @@ draw (cairo_t *cr, int width, int height) cairo_rotate (cr, M_PI / 4.0); cairo_translate (cr, -surface_size/2, -surface_size/2); - cairo_set_source_surface (cr, surface, 0, 0); + cairo_set_source_surface (cr, cairo_get_target (cr_surface), 0, 0); + cairo_destroy (cr_surface); cairo_pattern_set_filter (cairo_get_source (cr), CAIRO_FILTER_NEAREST); cairo_paint (cr); - cairo_surface_destroy (surface); return CAIRO_TEST_SUCCESS; }