compositor: add weston_surface_to_global_float helper

Ander Conselvan de Oliveira 13 years ago committed by Kristian Høgsberg
parent b8ab14fe04
commit fbf2894812
  1. 13
      src/compositor.c
  2. 3
      src/compositor.h

@ -424,15 +424,22 @@ weston_surface_update_transform(struct weston_surface *surface)
weston_compositor_schedule_repaint(surface->compositor); weston_compositor_schedule_repaint(surface->compositor);
} }
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 WL_EXPORT void
weston_surface_to_global(struct weston_surface *surface, weston_surface_to_global(struct weston_surface *surface,
int32_t sx, int32_t sy, int32_t *x, int32_t *y) int32_t sx, int32_t sy, int32_t *x, int32_t *y)
{ {
GLfloat xf, yf; GLfloat xf, yf;
weston_surface_update_transform(surface); weston_surface_to_global_float(surface, sx, sy, &xf, &yf);
surface_to_global_float(surface, sx, sy, &xf, &yf);
*x = floorf(xf); *x = floorf(xf);
*y = floorf(yf); *y = floorf(yf);
} }

@ -342,6 +342,9 @@ weston_surface_update_transform(struct weston_surface *surface);
void void
weston_surface_to_global(struct weston_surface *surface, weston_surface_to_global(struct weston_surface *surface,
int32_t sx, int32_t sy, int32_t *x, int32_t *y); 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 void
weston_surface_from_global(struct weston_surface *surface, weston_surface_from_global(struct weston_surface *surface,

Loading…
Cancel
Save