[PATCH 09/12] compositor: Output repaint in clone mode
Xiong Zhang
xiong.y.zhang at intel.com
Fri Mar 7 00:27:27 PST 2014
Because clone output isn't in compositor->output_list, all the repaint
request are for master output.
When master output repaint, all the associated clone output must
repaint also.
Signed-off-by: Xiong Zhang <xiong.y.zhang at intel.com>
---
src/compositor.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/src/compositor.c b/src/compositor.c
index c9fe06c..72d29a0 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -1548,14 +1548,19 @@ output_update_damage(struct weston_output *output)
{
struct weston_compositor *ec = output->compositor;
pixman_region32_t new_damage;
+ struct weston_output *clone_output;
pixman_region32_init(&new_damage);
pixman_region32_intersect(&new_damage,
&ec->primary_plane.damage, &output->region);
pixman_region32_union(&output->damage, &output->damage, &new_damage);
pixman_region32_fini(&new_damage);
+
+ wl_list_for_each(clone_output, &output->clone_output_list, link)
+ output_update_damage(clone_output);
}
+
static void
compositor_accumulate_damage(struct weston_compositor *ec)
{
@@ -1855,6 +1860,7 @@ WL_EXPORT void
weston_output_schedule_repaint(struct weston_output *output)
{
struct weston_compositor *compositor = output->compositor;
+ struct weston_output *clone;
struct wl_event_loop *loop;
if (compositor->state == WESTON_COMPOSITOR_SLEEPING ||
@@ -1862,6 +1868,10 @@ weston_output_schedule_repaint(struct weston_output *output)
return;
loop = wl_display_get_event_loop(compositor->wl_display);
+
+ wl_list_for_each(clone, &output->clone_output_list, link)
+ weston_output_schedule_repaint(clone);
+
output->repaint_needed = 1;
if (output->repaint_scheduled)
return;
@@ -3351,6 +3361,8 @@ weston_output_init(struct weston_output *output, struct weston_compositor *c,
return;
}
+ wl_list_init(&output->clone_output_list);
+
/* Find the position for this output */
if (output->is_clone) {
output->x = output->master_output->x;
@@ -3367,7 +3379,8 @@ weston_output_init(struct weston_output *output, struct weston_compositor *c,
}
weston_output_init_geometry(output, output->x, output->y);
- weston_output_damage(output);
+ if (!output->is_clone)
+ weston_output_damage(output);
wl_signal_init(&output->frame_signal);
wl_signal_init(&output->destroy_signal);
@@ -3377,8 +3390,6 @@ weston_output_init(struct weston_output *output, struct weston_compositor *c,
output->id = ffs(~output->compositor->output_id_pool) - 1;
output->compositor->output_id_pool |= 1 << output->id;
- wl_list_init(&output->clone_output_list);
-
if (!output->is_clone) {
wl_list_insert(c->output_list.prev, &output->link);
--
1.8.3.2
More information about the wayland-devel
mailing list