summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2011-07-01 22:12:11 -0400
committerKristian Høgsberg <krh@bitplanet.net>2011-07-01 22:12:11 -0400
commit7341e9b6d94778b0a0f3ed7ccb1a39cf15933380 (patch)
tree18278e31321436f147c17b8b5111f01c9557ed43
parenta8bdeae1b6786752aa1fc669c52786eedc23b91f (diff)
compositor: Fix damage tracking for multi-head compositors
-rw-r--r--compositor/compositor.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/compositor/compositor.c b/compositor/compositor.c
index 104da6e..bb92f94 100644
--- a/compositor/compositor.c
+++ b/compositor/compositor.c
@@ -812,13 +812,13 @@ wlsc_output_set_cursor(struct wlsc_output *output,
out:
pixman_region32_fini(&cursor_region);
}
-
+
static void
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 opaque, new_damage, total_damage, repaint;
output->prepare_render(output);
@@ -833,22 +833,24 @@ wlsc_output_repaint(struct wlsc_output *output)
!(ec->focus && ec->fade.spring.current < 0.001));
pixman_region32_init(&new_damage);
- pixman_region32_intersect(&new_damage, &ec->damage, &output->region);
- pixman_region32_init(&clip);
- pixman_region32_copy(&clip, &output->region);
+ pixman_region32_copy(&new_damage, &ec->damage);
+ pixman_region32_init(&opaque);
+
wl_list_for_each(es, &ec->surface_list, link) {
- pixman_region32_intersect(&es->damage, &es->damage, &clip);
+ pixman_region32_subtract(&es->damage, &es->damage, &opaque);
pixman_region32_union(&new_damage, &new_damage, &es->damage);
- pixman_region32_subtract(&clip, &clip, &es->opaque);
+ pixman_region32_union(&opaque, &opaque, &es->opaque);
}
pixman_region32_subtract(&ec->damage, &ec->damage, &output->region);
+
pixman_region32_init(&total_damage);
pixman_region32_union(&total_damage, &new_damage,
&output->previous_damage);
- pixman_region32_copy(&output->previous_damage, &new_damage);
+ pixman_region32_intersect(&output->previous_damage,
+ &new_damage, &output->region);
- pixman_region32_fini(&clip);
+ pixman_region32_fini(&opaque);
pixman_region32_fini(&new_damage);
es = container_of(ec->surface_list.next, struct wlsc_surface, link);
@@ -881,9 +883,12 @@ wlsc_output_repaint(struct wlsc_output *output)
}
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(&repaint);
+ pixman_region32_intersect(&repaint, &output->region,
+ &es->damage);
+ wlsc_surface_draw(es, output, &repaint);
+ pixman_region32_subtract(&es->damage,
+ &es->damage, &output->region);
}
}
@@ -1029,6 +1034,7 @@ surface_attach(struct wl_client *client,
if (es->visual == NULL)
wl_list_insert(&es->compositor->surface_list, &es->link);
+ es->visual = buffer->visual;
wlsc_surface_configure(es, es->x + x, es->y + y,
buffer->width, buffer->height);