summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-09-13 22:50:11 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-09-13 22:54:18 +0100
commit5c59d989f9037f94c80ccd7929dc05f4a95be4df (patch)
tree5fe87b7fb2863b7bb75867450c62fde0a044893f /src
parent97282ef51a01ae2ac3a7a8bf3ebce841a60dc907 (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>
Diffstat (limited to 'src')
-rw-r--r--src/cairo-xlib-surface.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c
index 58576b822..718f4e731 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;
}