summaryrefslogtreecommitdiff
path: root/test/extend-pad.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2008-10-21 11:14:51 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2008-10-21 11:31:06 +0100
commit9b919b0e91b6c64acbcbfc05c72610188327be67 (patch)
tree8508e61b1fa84a751f7c286eac5d0d41dfa7771e /test/extend-pad.c
parent69415b4fc6387acda7498847f8181c802c8b0982 (diff)
downloadcairo-9b919b0e91b6c64acbcbfc05c72610188327be67.tar.gz
[test/extend-pad] Propagate errors.
Use cairo_get_target() to propagate errors from the secondary context.
Diffstat (limited to 'test/extend-pad.c')
-rw-r--r--test/extend-pad.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/extend-pad.c b/test/extend-pad.c
index 8c3c09c30..b122f1523 100644
--- a/test/extend-pad.c
+++ b/test/extend-pad.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,11 +77,10 @@ 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_set_source_surface (cr, surface, 1.5, 1.5);
- cairo_surface_destroy (surface);
+ cairo_set_source_surface (cr, cairo_get_target (cr_surface), 1.5, 1.5);
+ cairo_destroy (cr_surface);
/* Using EXTEND_REFLECT makes this test pass for image and xlib backends */
/*cairo_pattern_set_extend (cairo_get_source (cr), CAIRO_EXTEND_REFLECT);*/