diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2008-10-21 11:12:11 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2008-10-21 11:12:11 +0100 |
commit | 594fa0836f2526e0a7f44fc7184f7f09de7dd41f (patch) | |
tree | 8319181545a2a6281e0bab72a4596a57a1fae426 /test/device-offset.c | |
parent | 29da47be60b0373ff93769f9f373a20b15a01e0f (diff) | |
download | cairo-594fa0836f2526e0a7f44fc7184f7f09de7dd41f.tar.gz |
[test/device-offset] Propagate error.
Use cairo_get_target() to propagate errors from the secondary context.
Diffstat (limited to 'test/device-offset.c')
-rw-r--r-- | test/device-offset.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/device-offset.c b/test/device-offset.c index dfeb50815..a7a6731e2 100644 --- a/test/device-offset.c +++ b/test/device-offset.c @@ -65,20 +65,20 @@ draw (cairo_t *cr, int width, int height) SIZE / 2, SIZE / 2); cairo_surface_set_device_offset (surface, - SIZE / 2, - SIZE / 2); cr2 = cairo_create (surface); + cairo_surface_destroy (surface); cairo_set_source_rgb (cr2, 1, 0, 0); /* red */ draw_square (cr2); - cairo_destroy (cr2); /* Finally, copy the offset surface to the original destination. * The final result should be a blue square with the lower-right * quarter red. */ - cairo_set_source_surface (cr, surface, 0, 0); + cairo_set_source_surface (cr, cairo_get_target (cr2), 0, 0); + cairo_destroy (cr2); cairo_paint (cr); - cairo_surface_destroy (surface); return CAIRO_TEST_SUCCESS; } |