compositor: rewrite draw and input coordinate transformations

For unifying the coordinate system handling, introduce functions for
converting explicitly between the global and the surface local
coordinate systems.

Use these functions in the input path, replacing
weston_surface_transform().

In the draw path, rewrite transform_vertex() to take in surface local
coordinates.

As shell now uses the new functions, the rotation origin is properly
placed in the middle of the surface.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
diff --git a/src/compositor.h b/src/compositor.h
index 7555e85..7623921 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -267,6 +267,14 @@
 weston_surface_update_transform(struct weston_surface *surface);
 
 void
+weston_surface_to_global(struct weston_surface *surface,
+			 int32_t sx, int32_t sy, int32_t *x, int32_t *y);
+
+void
+weston_surface_from_global(struct weston_surface *surface,
+			   int32_t x, int32_t y, int32_t *sx, int32_t *sy);
+
+void
 weston_device_repick(struct wl_input_device *device, uint32_t time);
 
 void