summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2011-06-28 22:55:19 +0200
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2011-07-01 22:52:12 +0200
commita7080e0085a06a5978d1c3d1b1eb6583c1635383 (patch)
tree93aee955d7247e7ce848b0cb63f51b127c4d913c
parenta8bdeae1b6786752aa1fc669c52786eedc23b91f (diff)
compositor: Keep surface damage region across all output repaintsdamaging-2
The damage region cant be used as a temporary drawing region, since its needed for multiple outputs.
-rw-r--r--compositor/compositor.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/compositor/compositor.c b/compositor/compositor.c
index 104da6e..e95355a 100644
--- a/compositor/compositor.c
+++ b/compositor/compositor.c
@@ -818,7 +818,7 @@ wlsc_output_repaint(struct wlsc_output *output)
{
struct wlsc_compositor *ec = output->compositor;
struct wlsc_surface *es;
- pixman_region32_t clip, new_damage, total_damage;
+ pixman_region32_t clip, tmp, new_damage, total_damage;
output->prepare_render(output);
@@ -837,9 +837,11 @@ wlsc_output_repaint(struct wlsc_output *output)
pixman_region32_init(&clip);
pixman_region32_copy(&clip, &output->region);
wl_list_for_each(es, &ec->surface_list, link) {
- pixman_region32_intersect(&es->damage, &es->damage, &clip);
- pixman_region32_union(&new_damage, &new_damage, &es->damage);
+ pixman_region32_init(&tmp);
+ pixman_region32_intersect(&tmp, &es->damage, &clip);
+ pixman_region32_union(&new_damage, &new_damage, &tmp);
pixman_region32_subtract(&clip, &clip, &es->opaque);
+ pixman_region32_fini(&tmp);
}
pixman_region32_subtract(&ec->damage, &ec->damage, &output->region);
@@ -876,14 +878,17 @@ wlsc_output_repaint(struct wlsc_output *output)
wlsc_surface_draw(es, output, &total_damage);
} else {
wl_list_for_each(es, &ec->surface_list, link) {
- pixman_region32_copy(&es->damage, &total_damage);
+ pixman_region32_subtract(&es->damage, &es->damage, &output->region);
+ pixman_region32_union(&es->damage, &es->damage, &total_damage);
pixman_region32_subtract(&total_damage, &total_damage, &es->opaque);
}
wl_list_for_each_reverse(es, &ec->surface_list, link) {
- wlsc_surface_draw(es, output, &es->damage);
- pixman_region32_fini(&es->damage);
- pixman_region32_init(&es->damage);
+ pixman_region32_init(&tmp);
+ pixman_region32_intersect(&tmp, &es->damage, &output->region);
+ wlsc_surface_draw(es, output, &tmp);
+ pixman_region32_subtract(&es->damage, &es->damage, &output->region);
+ pixman_region32_fini(&tmp);
}
}