From f86f233b3e49c3f401b2fa02987b2193485e8be5 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 17 Oct 2008 20:14:06 +0100 Subject: [PATCH] [test/smask] Propagate error. Use cairo_get_target() to propagate errors from the secondary context. --- test/smask.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/smask.c b/test/smask.c index 2b1d5b360..d6f5e9966 100644 --- a/test/smask.c +++ b/test/smask.c @@ -51,6 +51,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); @@ -101,7 +102,6 @@ draw (cairo_t *cr, int width, int height) floor ((width - extents.width) / 2 + 0.5) - extents.x_bearing, floor (height - extents.height - 0.5) - extents.y_bearing - 5); cairo_show_text (cr2, "FG"); - cairo_destroy (cr2); cairo_set_source_rgb (cr, 0, 0, 1.0); cairo_paint (cr); @@ -116,8 +116,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; }