From ac04199db16cffccb8395c4dd7be378dc4cf9617 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Thu, 10 Feb 2022 12:17:13 -0600 Subject: [PATCH] libweston: Remove old coordinate conversion functions We don't need these anymore, as all users have been moved to the weston_coord equivalents. Signed-off-by: Derek Foreman --- include/libweston/libweston.h | 12 ----- libweston/compositor.c | 85 ---------------------------------- libweston/libweston-internal.h | 10 ---- 3 files changed, 107 deletions(-) diff --git a/include/libweston/libweston.h b/include/libweston/libweston.h index 42d8a6ee..51ae5ae0 100644 --- a/include/libweston/libweston.h +++ b/include/libweston/libweston.h @@ -1807,10 +1807,6 @@ weston_view_update_transform(struct weston_view *view); void weston_view_geometry_dirty(struct weston_view *view); -void -weston_view_to_global_float(struct weston_view *view, - float sx, float sy, float *x, float *y); - struct weston_coord_global __attribute__ ((warn_unused_result)) weston_coord_surface_to_global(const struct weston_view *view, struct weston_coord_surface coord); @@ -1823,14 +1819,6 @@ struct weston_coord_buffer __attribute__ ((warn_unused_result)) weston_coord_surface_to_buffer(const struct weston_surface *surface, struct weston_coord_surface coord); -void -weston_view_from_global(struct weston_view *view, - int32_t x, int32_t y, int32_t *vx, int32_t *vy); -void -weston_view_from_global_fixed(struct weston_view *view, - wl_fixed_t x, wl_fixed_t y, - wl_fixed_t *vx, wl_fixed_t *vy); - void weston_view_activate_input(struct weston_view *view, struct weston_seat *seat, diff --git a/libweston/compositor.c b/libweston/compositor.c index 497e5624..31f7e6b2 100644 --- a/libweston/compositor.c +++ b/libweston/compositor.c @@ -662,22 +662,6 @@ weston_surface_create(struct weston_compositor *compositor) return surface; } -WL_EXPORT void -weston_view_to_global_float(struct weston_view *view, - float sx, float sy, float *x, float *y) -{ - struct weston_vector v = { { sx, sy, 0.0f, 1.0f } }; - - assert(!view->transform.dirty); - - weston_matrix_transform(&view->transform.matrix, &v); - - assert(fabs(v.f[3]) > 1e-6); - - *x = v.f[0] / v.f[3]; - *y = v.f[1] / v.f[3]; -} - WL_EXPORT struct weston_coord_global weston_coord_surface_to_global(const struct weston_view *view, struct weston_coord_surface coord) @@ -788,18 +772,6 @@ weston_matrix_transform_region(pixman_region32_t *dest, free(dest_rects); } -WL_EXPORT void -weston_surface_to_buffer_float(struct weston_surface *surface, - float sx, float sy, float *bx, float *by) -{ - struct weston_vector v = {{sx, sy, 0.0, 1.0}}; - - weston_matrix_transform(&surface->surface_to_buffer_matrix, &v); - - *bx = v.f[0] / v.f[3]; - *by = v.f[1] / v.f[3]; -} - /** Transform a rectangle from surface coordinates to buffer coordinates * * \param surface The surface to fetch wp_viewport and buffer transformation @@ -1506,63 +1478,6 @@ weston_view_geometry_dirty(struct weston_view *view) weston_view_geometry_dirty(child); } -WL_EXPORT void -weston_view_to_global_fixed(struct weston_view *view, - wl_fixed_t vx, wl_fixed_t vy, - wl_fixed_t *x, wl_fixed_t *y) -{ - struct weston_coord_surface cs; - struct weston_coord_global cg; - - cs = weston_coord_surface_from_fixed(vx, vy, view->surface); - cg = weston_coord_surface_to_global(view, cs); - - *x = wl_fixed_from_double(cg.c.x); - *y = wl_fixed_from_double(cg.c.y); -} - -WL_EXPORT void -weston_view_from_global_float(struct weston_view *view, - float x, float y, float *vx, float *vy) -{ - struct weston_vector v = { { x, y, 0.0f, 1.0f } }; - - assert(!view->transform.dirty); - - weston_matrix_transform(&view->transform.inverse, &v); - - assert(fabs(v.f[3]) > 1e-6); - - *vx = v.f[0] / v.f[3]; - *vy = v.f[1] / v.f[3]; -} - -WL_EXPORT void -weston_view_from_global_fixed(struct weston_view *view, - wl_fixed_t x, wl_fixed_t y, - wl_fixed_t *vx, wl_fixed_t *vy) -{ - float vxf, vyf; - - weston_view_from_global_float(view, - wl_fixed_to_double(x), - wl_fixed_to_double(y), - &vxf, &vyf); - *vx = wl_fixed_from_double(vxf); - *vy = wl_fixed_from_double(vyf); -} - -WL_EXPORT void -weston_view_from_global(struct weston_view *view, - int32_t x, int32_t y, int32_t *vx, int32_t *vy) -{ - float vxf, vyf; - - weston_view_from_global_float(view, x, y, &vxf, &vyf); - *vx = floorf(vxf); - *vy = floorf(vyf); -} - /** * \param surface The surface to be repainted * diff --git a/libweston/libweston-internal.h b/libweston/libweston-internal.h index 54d71032..bfdc889f 100644 --- a/libweston/libweston-internal.h +++ b/libweston/libweston-internal.h @@ -344,9 +344,6 @@ bool weston_touch_device_can_calibrate(struct weston_touch_device *device); /* weston_surface */ -void -weston_surface_to_buffer_float(struct weston_surface *surface, - float x, float y, float *bx, float *by); pixman_box32_t weston_surface_to_buffer_rect(struct weston_surface *surface, pixman_box32_t rect); @@ -370,13 +367,6 @@ weston_spring_update(struct weston_spring *spring, const struct timespec *time); /* weston_view */ -void -weston_view_to_global_fixed(struct weston_view *view, - wl_fixed_t sx, wl_fixed_t sy, - wl_fixed_t *x, wl_fixed_t *y); -void -weston_view_from_global_float(struct weston_view *view, - float x, float y, float *vx, float *vy); bool weston_view_is_opaque(struct weston_view *ev, pixman_region32_t *region);