From c618a765403c4edaa6a46c32f72fab16cec48197 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 8 Jun 2020 17:35:21 +0200 Subject: surface: introduce wlr_surface_get_buffer_source_box This helper allows compositors to retrieve the buffer source box in buffer-local coordinates. --- include/wlr/types/wlr_surface.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include') diff --git a/include/wlr/types/wlr_surface.h b/include/wlr/types/wlr_surface.h index 250d28dd..2cd4ac5d 100644 --- a/include/wlr/types/wlr_surface.h +++ b/include/wlr/types/wlr_surface.h @@ -262,4 +262,15 @@ void wlr_surface_for_each_surface(struct wlr_surface *surface, void wlr_surface_get_effective_damage(struct wlr_surface *surface, pixman_region32_t *damage); +/** + * Get the source rectangle describing the region of the buffer that needs to + * be sampled to render this surface's current state. The box is in + * buffer-local coordinates. + * + * If the viewport's source rectangle is unset, the position is zero and the + * size is the buffer's. + */ +void wlr_surface_get_buffer_source_box(struct wlr_surface *surface, + struct wlr_fbox *box); + #endif -- cgit v1.2.3