compositor: move surface_to_global_float() definition
authorPekka Paalanen <ppaalanen@gmail.com>
Wed, 8 Feb 2012 13:23:15 +0000 (15:23 +0200)
committerPekka Paalanen <ppaalanen@gmail.com>
Fri, 10 Feb 2012 13:47:56 +0000 (15:47 +0200)
Move surface_to_global_float() definition earlier in the file. No code
changes.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
src/compositor.c

index 556aad4..f631e23 100644 (file)
@@ -231,6 +231,32 @@ weston_surface_set_color(struct weston_surface *surface,
 }
 
 static void
+surface_to_global_float(struct weston_surface *surface,
+                       int32_t sx, int32_t sy, GLfloat *x, GLfloat *y)
+{
+       if (surface->transform.enabled) {
+               struct weston_vector v = { { sx, sy, 0.0f, 1.0f } };
+
+               weston_matrix_transform(&surface->transform.matrix, &v);
+
+               if (fabsf(v.f[3]) < 1e-6) {
+                       fprintf(stderr, "warning: numerical instability in "
+                               "weston_surface_to_global(), divisor = %g\n",
+                               v.f[3]);
+                       *x = 0;
+                       *y = 0;
+                       return;
+               }
+
+               *x = v.f[0] / v.f[3];
+               *y = v.f[1] / v.f[3];
+       } else {
+               *x = sx + surface->geometry.x;
+               *y = sy + surface->geometry.y;
+       }
+}
+
+static void
 weston_surface_damage_below_noupdate(struct weston_surface *surface)
 {
        struct weston_surface *below;
@@ -344,32 +370,6 @@ weston_surface_update_transform(struct weston_surface *surface)
        }
 }
 
-static void
-surface_to_global_float(struct weston_surface *surface,
-                       int32_t sx, int32_t sy, GLfloat *x, GLfloat *y)
-{
-       if (surface->transform.enabled) {
-               struct weston_vector v = { { sx, sy, 0.0f, 1.0f } };
-
-               weston_matrix_transform(&surface->transform.matrix, &v);
-
-               if (fabsf(v.f[3]) < 1e-6) {
-                       fprintf(stderr, "warning: numerical instability in "
-                               "weston_surface_to_global(), divisor = %g\n",
-                               v.f[3]);
-                       *x = 0;
-                       *y = 0;
-                       return;
-               }
-
-               *x = v.f[0] / v.f[3];
-               *y = v.f[1] / v.f[3];
-       } else {
-               *x = sx + surface->geometry.x;
-               *y = sy + surface->geometry.y;
-       }
-}
-
 WL_EXPORT void
 weston_surface_to_global(struct weston_surface *surface,
                         int32_t sx, int32_t sy, int32_t *x, int32_t *y)