diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-03-22 20:14:09 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-03-22 20:14:09 +0000 |
commit | c42cdd2c9d883ef359ac57b65eba4ed15441181d (patch) | |
tree | ac856cb3e7c90851bb0cb2c086f9f213838973f5 | |
parent | fd96aa3de2218dcc6671636f35a24738e3cae996 (diff) |
xcb: Gracefully destroy any lingering fallback during finish.
A fallback should never persist beyond the flush into the finish, but
yet one remains in test/clip-shapes-unaligned-rectangles. For the time
been, simply clean up the rogue surface.
-rw-r--r-- | src/cairo-xcb-surface.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/cairo-xcb-surface.c b/src/cairo-xcb-surface.c index 82c3114a..5f91ef61 100644 --- a/src/cairo-xcb-surface.c +++ b/src/cairo-xcb-surface.c @@ -257,7 +257,10 @@ _cairo_xcb_surface_finish (void *abstract_surface) cairo_xcb_surface_t *surface = abstract_surface; cairo_status_t status; - assert (surface->fallback == NULL); + if (surface->fallback != NULL) { + cairo_surface_finish (surface->fallback); + cairo_surface_destroy (surface->fallback); + } cairo_list_del (&surface->link); @@ -683,7 +686,7 @@ static cairo_status_t _cairo_xcb_surface_flush (void *abstract_surface) { cairo_xcb_surface_t *surface = abstract_surface; - cairo_status_t status = CAIRO_STATUS_SUCCESS; + cairo_status_t status; if (surface->drm != NULL && ! surface->marked_dirty) return surface->drm->backend->flush (surface->drm); @@ -691,12 +694,14 @@ _cairo_xcb_surface_flush (void *abstract_surface) if (likely (surface->fallback == NULL)) return CAIRO_STATUS_SUCCESS; - if (! surface->base.finished) { - status = _put_image (surface, - (cairo_image_surface_t *) surface->fallback); + status = surface->base.status; + if (status == CAIRO_STATUS_SUCCESS && ! surface->base.finished) { + status = cairo_surface_status (surface->fallback); - if (status == CAIRO_STATUS_SUCCESS) - status = cairo_surface_status (surface->fallback); + if (status == CAIRO_STATUS_SUCCESS) { + status = _put_image (surface, + (cairo_image_surface_t *) surface->fallback); + } if (status == CAIRO_STATUS_SUCCESS) { status = _cairo_surface_attach_snapshot (&surface->base, |