From 9abf393bd8286ae141868893253b13cdca117ec9 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Wed, 8 Feb 2012 14:49:37 +0200 Subject: [PATCH] compositor: split weston_surface_damage_below() Extract the core into a function that does not call weston_surface_update_transform() or schedule repaint. Signed-off-by: Pekka Paalanen --- src/compositor.c | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/compositor.c b/src/compositor.c index 1545990..1c35585 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -231,6 +231,22 @@ weston_surface_set_color(struct weston_surface *surface, } static void +weston_surface_damage_below_noupdate(struct weston_surface *surface) +{ + struct weston_surface *below; + + if (surface->output == NULL) + return; + + if (surface->link.next == &surface->compositor->surface_list) + return; + + below = container_of(surface->link.next, struct weston_surface, link); + pixman_region32_union(&below->damage, &below->damage, + &surface->transform.boundingbox); +} + +static void surface_compute_bbox(struct weston_surface *surface, int32_t sx, int32_t sy, int32_t width, int32_t height, pixman_region32_t *bbox) @@ -429,20 +445,8 @@ weston_surface_damage(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; - - below = container_of(surface->link.next, struct weston_surface, link); - weston_surface_update_transform(surface); - pixman_region32_union(&below->damage, &below->damage, - &surface->transform.boundingbox); - + weston_surface_damage_below_noupdate(surface); weston_compositor_schedule_repaint(surface->compositor); } -- 2.7.4