From 220dd47bea588e65416faa2a51663304f8d0a8bc Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Fri, 22 Sep 2023 11:51:24 +0200 Subject: Increase reuse of mmap'ed data by FLTK Wayland buffer factory --- src/drivers/Wayland/Fl_Wayland_Graphics_Driver.H | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/drivers/Wayland/Fl_Wayland_Graphics_Driver.H') diff --git a/src/drivers/Wayland/Fl_Wayland_Graphics_Driver.H b/src/drivers/Wayland/Fl_Wayland_Graphics_Driver.H index 9991bd99f..8dfef0a97 100644 --- a/src/drivers/Wayland/Fl_Wayland_Graphics_Driver.H +++ b/src/drivers/Wayland/Fl_Wayland_Graphics_Driver.H @@ -30,20 +30,22 @@ class Fl_Wayland_Graphics_Driver : public Fl_Cairo_Graphics_Driver { public: struct draw_buffer { + unsigned char *buffer; + cairo_t *cairo_; size_t data_size; // of wl_buffer and buffer int stride; int width; - unsigned char *buffer; - cairo_t *cairo_; }; struct wld_buffer { struct draw_buffer draw_buffer; + struct wl_list link; // links all buffers from the same wl_shm_pool struct wl_buffer *wl_buffer; void *data; struct wl_callback *cb; - bool draw_buffer_needs_commit; struct wl_shm_pool *shm_pool; - struct wl_list link; // links all buffers from the same wl_shm_pool + bool draw_buffer_needs_commit; + bool in_use; // true while being committed + bool released; // true after buffer_release() was called }; struct wld_shm_pool_data { // one record attached to each wl_shm_pool object char *pool_memory; // start of mmap'ed memory encapsulated by the wl_shm_pool -- cgit v1.2.3