diff --git a/libweston/compositor.c b/libweston/compositor.c index 69d101c0..6fbe3c62 100644 --- a/libweston/compositor.c +++ b/libweston/compositor.c @@ -810,6 +810,16 @@ weston_surface_to_buffer_region(struct weston_surface *surface, free(dest_rects); } +WL_EXPORT void +weston_view_buffer_to_output_matrix(const struct weston_view *view, + const struct weston_output *output, + struct weston_matrix *matrix) +{ + *matrix = view->surface->buffer_to_surface_matrix; + weston_matrix_multiply(matrix, &view->transform.matrix); + weston_matrix_multiply(matrix, &output->matrix); +} + WL_EXPORT void weston_view_move_to_plane(struct weston_view *view, struct weston_plane *plane) diff --git a/libweston/libweston-internal.h b/libweston/libweston-internal.h index b47e918c..c0bb2d77 100644 --- a/libweston/libweston-internal.h +++ b/libweston/libweston-internal.h @@ -367,6 +367,10 @@ weston_view_takes_input_at_point(struct weston_view *view, int x, int y); void weston_view_move_to_plane(struct weston_view *view, struct weston_plane *plane); +void +weston_view_buffer_to_output_matrix(const struct weston_view *view, + const struct weston_output *output, + struct weston_matrix *matrix); pixman_box32_t weston_matrix_transform_rect(struct weston_matrix *matrix,