From 5e5408412694bf067e47d12c9c739801452d8f41 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 23 Sep 2008 21:49:37 +0100 Subject: [PATCH] [test-meta] Use real meta-surface snapshot. The meta-surface workaround an old bug, which is no longer present in the tree and open-coded the surface snapshot. However, the workaround itself was buggy (not respecting the surface content). The lesson to take away from this is not to add workarounds in test code for bugs in the library! --- src/test-meta-surface.c | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/src/test-meta-surface.c b/src/test-meta-surface.c index 4d1527aae..9554c53c4 100644 --- a/src/test-meta-surface.c +++ b/src/test-meta-surface.c @@ -307,43 +307,8 @@ static cairo_surface_t * _test_meta_surface_snapshot (void *abstract_other) { test_meta_surface_t *other = abstract_other; - cairo_status_t status; - /* XXX: Just making a snapshot of other->meta is what we really - * want. But this currently triggers a bug somewhere (the "mask" - * test from the test suite segfaults). - * - * For now, we'll create a new image surface and replay onto - * that. It would be tempting to replay into other->image and then - * return a snapshot of that, but that will cause the self-copy - * test to fail, (since our replay will be affected by a clip that - * should not have any effect on the use of the resulting snapshot - * as a source). - */ - -#if 0 return _cairo_surface_snapshot (other->meta); -#else - cairo_rectangle_int_t extents; - cairo_surface_t *surface; - - status = _cairo_surface_get_extents (other->image, &extents); - if (status) - return _cairo_surface_create_in_error (status); - - surface = cairo_surface_create_similar (other->image, - CAIRO_CONTENT_COLOR_ALPHA, - extents.width, - extents.height); - - status = _cairo_meta_surface_replay (other->meta, surface); - if (status) { - cairo_surface_destroy (surface); - surface = _cairo_surface_create_in_error (status); - } - - return surface; -#endif } static const cairo_surface_backend_t test_meta_surface_backend = {