mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-02-15 22:05:31 -05:00
buffer: introduce wlr_buffer_finish()
This commit is contained in:
parent
5eed5d622d
commit
7963ba6a0d
12 changed files with 38 additions and 9 deletions
|
|
@ -22,6 +22,11 @@ void wlr_buffer_init(struct wlr_buffer *buffer,
|
|||
wlr_addon_set_init(&buffer->addons);
|
||||
}
|
||||
|
||||
void wlr_buffer_finish(struct wlr_buffer *buffer) {
|
||||
wl_signal_emit_mutable(&buffer->events.destroy, NULL);
|
||||
wlr_addon_set_finish(&buffer->addons);
|
||||
}
|
||||
|
||||
static void buffer_consider_destroy(struct wlr_buffer *buffer) {
|
||||
if (!buffer->dropped || buffer->n_locks > 0) {
|
||||
return;
|
||||
|
|
@ -29,9 +34,6 @@ static void buffer_consider_destroy(struct wlr_buffer *buffer) {
|
|||
|
||||
assert(!buffer->accessing_data_ptr);
|
||||
|
||||
wl_signal_emit_mutable(&buffer->events.destroy, NULL);
|
||||
wlr_addon_set_finish(&buffer->addons);
|
||||
|
||||
buffer->impl->destroy(buffer);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,9 @@ static struct wlr_client_buffer *client_buffer_from_buffer(
|
|||
|
||||
static void client_buffer_destroy(struct wlr_buffer *buffer) {
|
||||
struct wlr_client_buffer *client_buffer = client_buffer_from_buffer(buffer);
|
||||
|
||||
wlr_buffer_finish(buffer);
|
||||
|
||||
wl_list_remove(&client_buffer->source_destroy.link);
|
||||
wl_list_remove(&client_buffer->renderer_destroy.link);
|
||||
wlr_texture_destroy(client_buffer->texture);
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ static struct wlr_dmabuf_buffer *dmabuf_buffer_from_buffer(
|
|||
|
||||
static void dmabuf_buffer_destroy(struct wlr_buffer *wlr_buffer) {
|
||||
struct wlr_dmabuf_buffer *buffer = dmabuf_buffer_from_buffer(wlr_buffer);
|
||||
wlr_buffer_finish(wlr_buffer);
|
||||
if (buffer->saved) {
|
||||
wlr_dmabuf_attributes_finish(&buffer->dmabuf);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ static struct wlr_readonly_data_buffer *readonly_data_buffer_from_buffer(
|
|||
static void readonly_data_buffer_destroy(struct wlr_buffer *wlr_buffer) {
|
||||
struct wlr_readonly_data_buffer *buffer =
|
||||
readonly_data_buffer_from_buffer(wlr_buffer);
|
||||
wlr_buffer_finish(wlr_buffer);
|
||||
free(buffer->saved_data);
|
||||
free(buffer);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue