summaryrefslogtreecommitdiff
path: root/test/mask.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2008-10-17 19:02:31 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2008-10-18 09:55:07 +0100
commit6e6d7e52a3c16787633e5059ae36f2fb0d03148a (patch)
tree3ccc5bcc837b5f875eff01dc3afaf966925bedc0 /test/mask.c
parenta56d4530d6149e2c4fc884a5cfeede2d6ff6d3b6 (diff)
[test/mask] Propagate error from secondary context.
Reset the source every time so that the error is propagate from the secondary context using cairo_get_target().
Diffstat (limited to 'test/mask.c')
-rw-r--r--test/mask.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/test/mask.c b/test/mask.c
index 44bed878..ec7cb8f1 100644
--- a/test/mask.c
+++ b/test/mask.c
@@ -191,7 +191,6 @@ draw (cairo_t *cr, int width, int height)
{
const cairo_test_context_t *ctx = cairo_test_get_context (cr);
cairo_surface_t *tmp_surface;
- cairo_pattern_t *tmp_pattern;
size_t i, j, k;
cairo_t *cr2;
@@ -202,10 +201,6 @@ draw (cairo_t *cr, int width, int height)
CAIRO_CONTENT_COLOR_ALPHA,
IMAGE_WIDTH, IMAGE_HEIGHT);
cr2 = cairo_create (tmp_surface);
-
- tmp_pattern = cairo_pattern_create_for_surface (tmp_surface);
- cairo_set_source (cr, tmp_pattern);
- cairo_pattern_destroy (tmp_pattern);
cairo_surface_destroy (tmp_surface);
for (k = 0; k < ARRAY_SIZE (clip_funcs); k++) {
@@ -230,6 +225,7 @@ draw (cairo_t *cr, int width, int height)
cairo_restore (cr2);
/* Copy back to the main pixmap */
+ cairo_set_source_surface (cr, cairo_get_target (cr2), 0, 0);
cairo_rectangle (cr, x, y, WIDTH, HEIGHT);
cairo_fill (cr);
}