summaryrefslogtreecommitdiff
path: root/test/zero-alpha.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-04-27 21:04:52 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2010-04-28 08:39:21 +0100
commitd3c4349730be991db0c85094103c744fc2d94836 (patch)
tree51000654083972900fd7346a8c03ccf8901a3aeb /test/zero-alpha.c
parenta5f54e48e3136076f3c8c60fc068f6a2105d9a33 (diff)
downloadcairo-d3c4349730be991db0c85094103c744fc2d94836.tar.gz
test: Mark surfaces as finished if the data goes out of scope.
The issue being that as the on-stack data is being referenced via a zero-copy snapshot outside of the functions scope as the surface is only finished and the source written long after the draw() returns. The correct procedure is that the user must call cairo_surface_finish() prior to any surface becoming inaccessible. In this case, this triggers the snapshot to preserve a copy of the data whilst it is still valid.
Diffstat (limited to 'test/zero-alpha.c')
-rw-r--r--test/zero-alpha.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/zero-alpha.c b/test/zero-alpha.c
index 1c7c94b05..0105cc8e6 100644
--- a/test/zero-alpha.c
+++ b/test/zero-alpha.c
@@ -81,6 +81,7 @@ draw (cairo_t *cr, int width, int height)
for (i=0; i < REPS; i++)
cairo_paint (cr);
+ cairo_surface_finish (surface); /* zero will go out of scope */
cairo_surface_destroy (surface);
return CAIRO_TEST_SUCCESS;