summaryrefslogtreecommitdiff
path: root/src/drivers/Wayland/Fl_Wayland_Graphics_Driver.H
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-09-22 11:51:24 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-09-22 11:51:24 +0200
commit220dd47bea588e65416faa2a51663304f8d0a8bc (patch)
tree01a63c78bfe184370ee0144f1086c62147ac634b /src/drivers/Wayland/Fl_Wayland_Graphics_Driver.H
parentcee69943e5986f471d49b1378311cb06e1487733 (diff)
Increase reuse of mmap'ed data by FLTK Wayland buffer factory
Diffstat (limited to 'src/drivers/Wayland/Fl_Wayland_Graphics_Driver.H')
-rw-r--r--src/drivers/Wayland/Fl_Wayland_Graphics_Driver.H10
1 files changed, 6 insertions, 4 deletions
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