From c1e6c8a2ed9cad6ba0211a2097cbc510d604656b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Tue, 19 Feb 2013 17:04:50 -0500 Subject: [PATCH] compositor: Make sure surface->transform.matrix,inverse are always valid First step towards getting rid of the transform.enabled optimization. --- src/compositor.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/compositor.c b/src/compositor.c index 8f523a87..eb0195a2 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -596,6 +596,17 @@ weston_surface_update_transform_disable(struct weston_surface *surface) surface->geometry.x = roundf(surface->geometry.x); surface->geometry.y = roundf(surface->geometry.y); + /* Otherwise identity matrix, but with x and y translation. */ + surface->transform.position.matrix.type = WESTON_MATRIX_TRANSFORM_TRANSLATE; + surface->transform.position.matrix.d[12] = surface->geometry.x; + surface->transform.position.matrix.d[13] = surface->geometry.y; + + surface->transform.matrix = surface->transform.position.matrix; + + surface->transform.inverse.type = WESTON_MATRIX_TRANSFORM_TRANSLATE; + surface->transform.inverse.d[12] = -surface->geometry.x; + surface->transform.inverse.d[13] = -surface->geometry.y; + pixman_region32_init_rect(&surface->transform.boundingbox, surface->geometry.x, surface->geometry.y,