diff options
| author | Kristian Høgsberg <krh@bitplanet.net> | 2012-02-28 22:47:14 -0500 |
|---|---|---|
| committer | Kristian Høgsberg <krh@bitplanet.net> | 2012-03-01 12:47:23 -0500 |
| commit | 1e8321213d92097682ab4bb692c19c6289fe72fd (patch) | |
| tree | c8dc6642cabb12b62d3e8fa59ecc03d4dca18332 | |
| parent | 6ddcdaeb983edb3b952e32909d27458e28bdedb9 (diff) | |
compositor: Implement damage_below by using the new compositor->damage
We can now clip the surface bounding box against the previous frame
opaque clip, and then just union the result (visible damage) into
compositor->damage immediately.
| -rw-r--r-- | src/compositor.c | 34 |
1 files changed, 8 insertions, 26 deletions
diff --git a/src/compositor.c b/src/compositor.c index 434c493..7e4e7a6 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -282,17 +282,15 @@ surface_to_global_float(struct weston_surface *surface, WL_EXPORT void weston_surface_damage_below(struct weston_surface *surface) { - struct weston_surface *below; - - if (surface->output == NULL) - return; - - if (surface->link.next == &surface->compositor->surface_list) - return; + struct weston_compositor *compositor = surface->compositor; + pixman_region32_t damage; - below = container_of(surface->link.next, struct weston_surface, link); - pixman_region32_union(&below->damage, &below->damage, - &surface->transform.boundingbox); + pixman_region32_init(&damage); + pixman_region32_subtract(&damage, &surface->transform.boundingbox, + &surface->clip); + pixman_region32_union(&compositor->damage, + &compositor->damage, &damage); + pixman_region32_fini(&damage); } static void @@ -511,21 +509,6 @@ weston_surface_damage(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, GLfloat x, GLfloat y, int width, int height) @@ -615,7 +598,6 @@ static void weston_surface_unmap(struct weston_surface *surface) { weston_surface_damage_below(surface); - weston_surface_flush_damage(surface); surface->output = NULL; wl_list_remove(&surface->link); weston_compositor_repick(surface->compositor); |
