From: Pekka Paalanen Date: Thu, 9 Feb 2012 13:27:45 +0000 (+0200) Subject: compositor: simplify weston_surface_damage_rectangle() X-Git-Tag: 20120702.1049~490 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1d5035c705b524aed21233bd46515dc66c0c2fb4;p=profile%2Fivi%2Fweston.git compositor: simplify weston_surface_damage_rectangle() The non-transformed case looked a little odd, calling weston_surface_to_global(), since it already tests for transform.enabled and simply uses width, height for the box. Streamline it, by open-coding weston_surface_to_global(), and avoiding another call into weston_surface_update_transform(). This way it does not look suspicious to me. Signed-off-by: Pekka Paalanen --- diff --git a/src/compositor.c b/src/compositor.c index 0c62fb0..486bd22 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -437,10 +437,10 @@ weston_surface_damage_rectangle(struct weston_surface *surface, &box); pixman_region32_fini(&box); } else { - int32_t x, y; - weston_surface_to_global(surface, sx, sy, &x, &y); pixman_region32_union_rect(&surface->damage, &surface->damage, - x, y, width, height); + surface->geometry.x + sx, + surface->geometry.y + sy, + width, height); } weston_compositor_schedule_repaint(surface->compositor);