From 750d0ad4583732ee24c998f46a62fc684f86bc48 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 9 Aug 2017 23:34:50 -0400 Subject: Flesh out wlr_surface state lifecycle a bit Sprinked some TODOs around for future work --- include/wlr/types/wlr_surface.h | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/wlr/types/wlr_surface.h b/include/wlr/types/wlr_surface.h index 2bfd5d36..b80b1de4 100644 --- a/include/wlr/types/wlr_surface.h +++ b/include/wlr/types/wlr_surface.h @@ -1,21 +1,40 @@ #ifndef _WLR_TYPES_WLR_SURFACE_H #define _WLR_TYPES_WLR_SURFACE_H - #include +#include +#include struct wlr_frame_callback { struct wl_resource *resource; struct wl_list link; }; -struct wlr_surface { - struct wl_resource *pending_buffer; - bool pending_attached; - bool attached; // whether the surface currently has a buffer attached +#define WLR_SURFACE_INVALID_BUFFER 1 +#define WLR_SURFACE_INVALID_SURFACE_DAMAGE 2 +#define WLR_SURFACE_INVALID_BUFFER_DAMAGE 4 +#define WLR_SURFACE_INVALID_OPAQUE_REGION 8 +#define WLR_SURFACE_INVALID_INPUT_REGION 16 +#define WLR_SURFACE_INVALID_TRANSFORM 16 +#define WLR_SURFACE_INVALID_SCALE 16 + +struct wlr_surface_state { + uint32_t invalid; + struct wl_resource *buffer; + int32_t sx, sy; + pixman_region32_t surface_damage, buffer_damage; + pixman_region32_t opaque, input; + uint32_t transform; + int32_t scale; +}; +struct wlr_surface { + struct wl_resource *resource; struct wlr_texture *texture; + struct wlr_surface_state current, pending; const char *role; // the lifetime-bound role or null - struct wl_resource *resource; + + float buffer_to_surface_matrix[16]; + float surface_to_buffer_matrix[16]; struct { struct wl_signal destroy; -- cgit v1.2.3