[PATCH 3/7] compositor: add weston_surface_to_global_float helper

Ander Conselvan de Oliveira ander.conselvan.de.oliveira at intel.com
Tue Mar 27 07:36:37 PDT 2012


---
 src/compositor.c |   13 ++++++++++---
 src/compositor.h |    3 +++
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/compositor.c b/src/compositor.c
index 353bf21..63bed72 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -425,14 +425,21 @@ weston_surface_update_transform(struct weston_surface *surface)
 }
 
 WL_EXPORT void
+weston_surface_to_global_float(struct weston_surface *surface,
+			       int32_t sx, int32_t sy, GLfloat *x, GLfloat *y)
+{
+	weston_surface_update_transform(surface);
+
+	surface_to_global_float(surface, sx, sy, x, y);
+}
+
+WL_EXPORT void
 weston_surface_to_global(struct weston_surface *surface,
 			 int32_t sx, int32_t sy, int32_t *x, int32_t *y)
 {
 	GLfloat xf, yf;
 
-	weston_surface_update_transform(surface);
-
-	surface_to_global_float(surface, sx, sy, &xf, &yf);
+	weston_surface_to_global_float(surface, sx, sy, &xf, &yf);
 	*x = floorf(xf);
 	*y = floorf(yf);
 }
diff --git a/src/compositor.h b/src/compositor.h
index a88a6ba..58bae0f 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -342,6 +342,9 @@ 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_to_global_float(struct weston_surface *surface,
+			       int32_t sx, int32_t sy, GLfloat *x, GLfloat *y);
 
 void
 weston_surface_from_global(struct weston_surface *surface,
-- 
1.7.4.1



More information about the wayland-devel mailing list