diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-09-13 22:50:11 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-09-13 22:54:18 +0100 |
commit | 5c59d989f9037f94c80ccd7929dc05f4a95be4df (patch) | |
tree | 5fe87b7fb2863b7bb75867450c62fde0a044893f | |
parent | 97282ef51a01ae2ac3a7a8bf3ebce841a60dc907 (diff) |
xlib: Destroy the fallback damage along with the fallback surface
Whenever we discard the fallback surface, we need to destroy the
associated damage tracking, so move this into the common discard
routine.
This should fix the issue when trying to flush the fallback before
the user modifies any foreign Drawables. The current code issued the
flush and then explicitly discard the fallback, but unless it was idle
at the time of the flush the associated damage would not have also been
destroyed. Asserts followed.
References: https://bugs.freedesktop.org/show_bug.cgi?id=54657
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/cairo-xlib-surface.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c index 58576b82..718f4e73 100644 --- a/src/cairo-xlib-surface.c +++ b/src/cairo-xlib-surface.c @@ -370,8 +370,10 @@ _cairo_xlib_surface_discard_shm (cairo_xlib_surface_t *surface) cairo_surface_finish (surface->shm); cairo_surface_destroy (surface->shm); - surface->shm = NULL; + + _cairo_damage_destroy (surface->base.damage); + surface->base.damage = NULL; } static cairo_status_t @@ -1447,13 +1449,8 @@ _cairo_xlib_surface_flush (void *abstract_surface, return status; surface->fallback >>= 1; - if (surface->shm && _cairo_xlib_shm_surface_is_idle (surface->shm)) { - cairo_surface_destroy (surface->shm); - surface->shm = NULL; - - _cairo_damage_destroy (surface->base.damage); - surface->base.damage = NULL; - } + if (surface->shm && _cairo_xlib_shm_surface_is_idle (surface->shm)) + _cairo_xlib_surface_discard_shm (surface); return CAIRO_STATUS_SUCCESS; } |