weston_buffer: Add mode to weston_buffer_reference

Add a mode argument to weston_buffer_reference which indicates whether a
buffer's storage may/will be accessed, or whether the underlying storage
will no longer be accessed, e.g. because it has been copied. This will
be used to retain a pointer to the weston_buffer whilst being able to
send a release event to the client.

Signed-off-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
Daniel Stone
2022-01-15 03:12:53 +00:00
parent 7e90433079
commit fdc7b9c352
7 changed files with 63 additions and 20 deletions
+7
View File
@@ -1201,8 +1201,15 @@ struct weston_buffer {
uint64_t format_modifier;
};
enum weston_buffer_reference_type {
BUFFER_REF_NONE,
BUFFER_MAY_BE_ACCESSED,
BUFFER_WILL_NOT_BE_ACCESSED,
};
struct weston_buffer_reference {
struct weston_buffer *buffer;
enum weston_buffer_reference_type type;
};
struct weston_buffer_viewport {