diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-04-27 21:04:52 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-04-28 08:39:21 +0100 |
commit | d3c4349730be991db0c85094103c744fc2d94836 (patch) | |
tree | 51000654083972900fd7346a8c03ccf8901a3aeb /test/zero-alpha.c | |
parent | a5f54e48e3136076f3c8c60fc068f6a2105d9a33 (diff) |
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.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/test/zero-alpha.c b/test/zero-alpha.c index 1c7c94b0..0105cc8e 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; |