summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2012-01-18 21:41:37 -0500
committerKristian Høgsberg <krh@bitplanet.net>2012-01-18 21:41:37 -0500
commit90b53815ba4d6711878430c4df360f62b8eac080 (patch)
tree590697a66d24c202b6b3a09972c701fcb7edc112
parent6916d9cb6f9cba8742b953847ea665a44bc0ab30 (diff)
downloadweston-90b53815ba4d6711878430c4df360f62b8eac080.tar.gz
compositor: Flush surface damage to surface below on destroy
When we destroy a surface, we damage the surface below so that the area exposed by the disappearing surface will be repainted. However, if that surface also is destroyed, the damage information is lost and we fail to repaint that area. This commit introduces weston_surface_flush_damage(), which flushes the surface damage the the surface below when a surface is destroyed. When multiple surfaces are destroyed at the same time, the damage now accumulates and sinks down through the surface stack as it should.
-rw-r--r--src/compositor.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/compositor.c b/src/compositor.c
index 2e0a3f8e..5b5bcc7b 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -287,6 +287,21 @@ weston_surface_damage_below(struct weston_surface *surface)
weston_compositor_schedule_repaint(surface->compositor);
}
+static void
+weston_surface_flush_damage(struct weston_surface *surface)
+{
+ struct weston_surface *below;
+
+ if (surface->output &&
+ surface->link.next != &surface->compositor->surface_list) {
+ below = container_of(surface->link.next,
+ struct weston_surface, link);
+
+ pixman_region32_union(&below->damage,
+ &below->damage, &surface->damage);
+ }
+}
+
WL_EXPORT void
weston_surface_configure(struct weston_surface *surface,
int x, int y, int width, int height)
@@ -376,6 +391,7 @@ destroy_surface(struct wl_resource *resource)
struct weston_compositor *compositor = surface->compositor;
weston_surface_damage_below(surface);
+ weston_surface_flush_damage(surface);
wl_list_remove(&surface->link);
weston_compositor_repick(compositor);