compositor: drop inverse matrix from weston_transform

Remove the inverse matrix member from struct weston_transform. It is
easier (and probably faster, too) to create and store only forward
transformation matrices in a list, multiply them once, and then invert
the final matrix, rather than creating both forward and inverse
matrices, and multiplying both.

Add a stub for the 4x4 matrix inversion function.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
diff --git a/src/compositor.c b/src/compositor.c
index 0a7dea3..69ad60e 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -505,7 +505,7 @@
 	t.f[2] = 0.0;
 	t.f[3] = 1.0;
 
-	weston_matrix_transform(&surface->transform.cached.matrix, &t);
+	weston_matrix_transform(&surface->transform.matrix, &t);
 
 	/* XXX: assumes last row of matrix is [0 0 * 1] */
 
@@ -544,8 +544,8 @@
 static void
 weston_surface_update_transform(struct weston_surface *surface)
 {
-	struct weston_matrix *matrix = &surface->transform.cached.matrix;
-	struct weston_matrix *inverse = &surface->transform.cached.inverse;
+	struct weston_matrix *matrix = &surface->transform.matrix;
+	struct weston_matrix *inverse = &surface->transform.inverse;
 	struct weston_transform *tform;
 
 	if (!surface->transform.dirty)
@@ -564,9 +564,7 @@
 	wl_list_for_each(tform, &surface->transform.list, link)
 		weston_matrix_multiply(matrix, &tform->matrix);
 
-	weston_matrix_init(inverse);
-	wl_list_for_each_reverse(tform, &surface->transform.list, link)
-		weston_matrix_multiply(inverse, &tform->inverse);
+	weston_matrix_invert(inverse, matrix);
 }
 
 WL_EXPORT void