summaryrefslogtreecommitdiff
path: root/test/rotate-image-surface-paint.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2008-10-21 11:19:40 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2008-10-21 11:31:11 +0100
commitb5551cfce2969358746dadae90cbe1add012e29c (patch)
tree526aa3326f0fff4342825723b5c7b68151afe90f /test/rotate-image-surface-paint.c
parent6d41ffbbed2ad3bab2b1a58e1e5d9e1570a37926 (diff)
downloadcairo-b5551cfce2969358746dadae90cbe1add012e29c.tar.gz
[test/rotate-image-surface-paint] Proapgate errors.
Use cairo_get_target() to propagate errors from the secondary context.
Diffstat (limited to 'test/rotate-image-surface-paint.c')
-rw-r--r--test/rotate-image-surface-paint.c7
1 files 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;
}