From 3c96d0b68e3f3d270e885c4d7bb82ae8667ba385 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Tue, 21 May 2024 16:09:34 +0200 Subject: render: use single-pixel buffers for overlays, when possible The unicode-mode, and flash overlays are single color buffers. This means we can use the single-pixel buffer protocol. It's undefined whether the compositor will release the buffer or not; to make things easier, simply destroy the buffer as soon as we've committed it. Note that since compositors don't necessarily release single-pixel buffers, we can't plug them into our own buffer interface. This means we can't use buffer pointers to check if we can re-use the previous buffer (i.e. we can skip comitting a new buffer), or if we have to create a new one. It's _almost_ enough to just check if the last overlay style is the same as the current one. Except that that doesn't take window resizes into account... --- wayland.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'wayland.h') diff --git a/wayland.h b/wayland.h index 215640aa..7688fbdb 100644 --- a/wayland.h +++ b/wayland.h @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -439,10 +440,12 @@ struct wayland { struct wp_cursor_shape_manager_v1 *cursor_shape_manager; + struct wp_single_pixel_buffer_manager_v1 *single_pixel_manager; + bool presentation_timings; struct wp_presentation *presentation; uint32_t presentation_clock_id; - + #if defined(FOOT_IME_ENABLED) && FOOT_IME_ENABLED struct zwp_text_input_manager_v3 *text_input_manager; #endif -- cgit v1.3