mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-01 22:58:38 -04:00
buffer: replace get_data_ptr with {begin,end}_data_ptr_access
This new API allows buffer implementations to know when a user is actively accessing the buffer's underlying storage. This is important for the upcoming client-backed wlr_buffer implementation.
This commit is contained in:
parent
9e58301df7
commit
38ba5881a0
7 changed files with 79 additions and 18 deletions
|
|
@ -26,10 +26,11 @@ struct wlr_buffer_impl {
|
|||
void (*destroy)(struct wlr_buffer *buffer);
|
||||
bool (*get_dmabuf)(struct wlr_buffer *buffer,
|
||||
struct wlr_dmabuf_attributes *attribs);
|
||||
bool (*get_data_ptr)(struct wlr_buffer *buffer, void **data,
|
||||
uint32_t *format, size_t *stride);
|
||||
bool (*get_shm)(struct wlr_buffer *buffer,
|
||||
struct wlr_shm_attributes *attribs);
|
||||
bool (*begin_data_ptr_access)(struct wlr_buffer *buffer, void **data,
|
||||
uint32_t *format, size_t *stride);
|
||||
void (*end_data_ptr_access)(struct wlr_buffer *buffer);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -47,6 +48,7 @@ struct wlr_buffer {
|
|||
|
||||
bool dropped;
|
||||
size_t n_locks;
|
||||
bool accessing_data_ptr;
|
||||
|
||||
struct {
|
||||
struct wl_signal destroy;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue