summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2008-10-21 11:21:37 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2008-10-21 11:31:11 +0100
commit4c8de6d99d337338d6fd57134247515f9815b5e5 (patch)
treeefa6c797849848cb1a4834c34dda7690a730ff73
parente8de7d1c3605fa6d89640fb4e0631c07e5366348 (diff)
[test/surface-pattern-scale-up] Propagate errors.
Use cairo_get_target() to propagate errors from the secondary context.
-rw-r--r--test/surface-pattern-scale-up.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/surface-pattern-scale-up.c b/test/surface-pattern-scale-up.c
index ef7a4d136..3c097532e 100644
--- a/test/surface-pattern-scale-up.c
+++ b/test/surface-pattern-scale-up.c
@@ -55,6 +55,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,
@@ -75,12 +77,11 @@ 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);
cairo_scale (cr, 10, 10);
cairo_rotate (cr, 1.);
- cairo_set_source_surface (cr, surface, 4, -4.5);
- cairo_surface_destroy (surface);
+ cairo_set_source_surface (cr, cairo_get_target (cr_surface), 4, -4.5);
+ cairo_destroy (cr_surface);
cairo_pattern_set_extend (cairo_get_source (cr), CAIRO_EXTEND_NONE);
cairo_paint (cr);