summaryrefslogtreecommitdiff
path: root/test/surface-pattern.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2008-10-17 20:37:43 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2008-10-18 09:55:07 +0100
commit794160c35baf39593942ba71b45e4e75d2a87103 (patch)
tree5ec3bf06221b5705e1ba0eedc642e9534084d483 /test/surface-pattern.c
parent0f48cce8d90cf95afcf86d71a932ab4e504b909b (diff)
downloadcairo-794160c35baf39593942ba71b45e4e75d2a87103.tar.gz
[test/surface-pattern] Propagate error.
Use cairo_get_target() to propagate error from secondary context.
Diffstat (limited to 'test/surface-pattern.c')
-rw-r--r--test/surface-pattern.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/surface-pattern.c b/test/surface-pattern.c
index 41ffdc961..6afdcda9a 100644
--- a/test/surface-pattern.c
+++ b/test/surface-pattern.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, 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);
cairo_pattern_set_extend (cairo_get_source (cr), CAIRO_EXTEND_REPEAT);
cairo_paint (cr);