From 965167807000f1b6885a725579e57c0b8ad5c10d Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Thu, 9 Feb 2012 15:32:15 +0200 Subject: [PATCH] compositor: let update_transform deal damage weston_surface_update_transform() is similar to weston_surface_configure() in that it changes the surface region on screen. Unlike configure, update_transform forgets to deal damage at all, yet it is the only place where we can do damage_below() as needed. Add a damage_below call to deal damage for the old surface region only when needed. This uses the cached state from surface->transform to get the old region. Add a damage call to deal damage for the new surface region, after updating the cached state. Add a repaint call, since we have changed the scene and should render it out. This change fixes the rotation not updating the screen properly. Signed-off-by: Pekka Paalanen --- src/compositor.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/compositor.c b/src/compositor.c index 486bd22a..5baf50ab 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -357,6 +357,8 @@ weston_surface_update_transform(struct weston_surface *surface) surface->geometry.dirty = 0; + weston_surface_damage_below_noupdate(surface); + pixman_region32_fini(&surface->transform.boundingbox); /* transform.position is always in transformation_list */ @@ -369,6 +371,12 @@ weston_surface_update_transform(struct weston_surface *surface) if (weston_surface_update_transform_enable(surface) < 0) weston_surface_update_transform_disable(surface); } + + /* weston_surface_damage() without update */ + pixman_region32_union(&surface->damage, &surface->damage, + &surface->transform.boundingbox); + + weston_compositor_schedule_repaint(surface->compositor); } WL_EXPORT void