diff options
author | Kristian Høgsberg <krh@bitplanet.net> | 2011-11-11 11:48:12 -0500 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2011-11-11 11:48:15 -0500 |
commit | d82640447206f7771bf46c1a3c2bada03270d2ea (patch) | |
tree | d2fd45771a138f4e7c2638baa40ef7db66a7d002 | |
parent | 46770139bceabb48ae0c2842f7f66d64fef26b6f (diff) |
compositor: Drop redundant compositor->damage
This is the same as the damage of the top-level surface so just use that.
There's a problem that if we change the stacking, the damage layering breaks,
but that's a problem we already have.
-rw-r--r-- | compositor/compositor.c | 24 | ||||
-rw-r--r-- | compositor/compositor.h | 1 |
2 files changed, 10 insertions, 15 deletions
diff --git a/compositor/compositor.c b/compositor/compositor.c index e3e8bdf..27d9834 100644 --- a/compositor/compositor.c +++ b/compositor/compositor.c @@ -767,9 +767,14 @@ WL_EXPORT void wlsc_output_damage(struct wlsc_output *output) { struct wlsc_compositor *compositor = output->compositor; + struct wlsc_surface *es; + + if (wl_list_empty(&compositor->surface_list)) + return; - pixman_region32_union(&compositor->damage, - &compositor->damage, &output->region); + es = container_of(compositor->surface_list.next, + struct wlsc_surface, link); + pixman_region32_union(&es->damage, &es->damage, &output->region); wlsc_compositor_schedule_repaint(compositor); } @@ -905,7 +910,6 @@ wlsc_output_repaint(struct wlsc_output *output) ec->fade.spring.current >= 0.001); pixman_region32_init(&new_damage); - pixman_region32_copy(&new_damage, &ec->damage); pixman_region32_init(&opaque); wl_list_for_each(es, &ec->surface_list, link) { @@ -914,8 +918,6 @@ wlsc_output_repaint(struct wlsc_output *output) 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); @@ -927,13 +929,9 @@ wlsc_output_repaint(struct wlsc_output *output) es = container_of(ec->surface_list.next, struct wlsc_surface, link); - if (setup_scanout_surface(output, es) == 0) { - /* We're drawing nothing now, - * draw the damaged regions later. */ - pixman_region32_union(&ec->damage, &ec->damage, &total_damage); - + if (setup_scanout_surface(output, es) == 0) + /* We're drawing nothing, just let the damage accumulate */ return; - } if (es->fullscreen_output == output) { if (es->width < output->current->width || @@ -1918,7 +1916,6 @@ wlsc_output_destroy(struct wlsc_output *output) WL_EXPORT void wlsc_output_move(struct wlsc_output *output, int x, int y) { - struct wlsc_compositor *c = output->compositor; int flip; output->x = x; @@ -1939,7 +1936,7 @@ wlsc_output_move(struct wlsc_output *output, int x, int y) 2.0 / output->current->width, flip * 2.0 / output->current->height, 1); - pixman_region32_union(&c->damage, &c->damage, &output->region); + wlsc_output_damage(output); } WL_EXPORT void @@ -2090,7 +2087,6 @@ wlsc_compositor_init(struct wlsc_compositor *ec, struct wl_display *display) ec->idle_source = wl_event_loop_add_timer(loop, idle_handler, ec); wl_event_source_timer_update(ec->idle_source, option_idle_time * 1000); - pixman_region32_init(&ec->damage); wlsc_compositor_schedule_repaint(ec); return 0; diff --git a/compositor/compositor.h b/compositor/compositor.h index 1cde1d9..95d3017 100644 --- a/compositor/compositor.h +++ b/compositor/compositor.h @@ -215,7 +215,6 @@ struct wlsc_compositor { /* Repaint state. */ struct timespec previous_swap; - pixman_region32_t damage; struct wl_array vertices, indices; struct wlsc_surface *overlay; |