render/texture: add destroy event

This commit is contained in:
Simon Ser 2024-03-06 17:59:44 +01:00
parent 0db8e14ce0
commit 4ccc774dbb
2 changed files with 7 additions and 0 deletions

View file

@ -24,6 +24,10 @@ struct wlr_texture {
uint32_t width, height;
struct wlr_renderer *renderer;
struct {
struct wl_signal destroy;
} events;
};
struct wlr_texture_read_pixels_options {

View file

@ -18,9 +18,12 @@ void wlr_texture_init(struct wlr_texture *texture, struct wlr_renderer *renderer
.width = width,
.height = height,
};
wl_signal_init(&texture->events.destroy);
}
void wlr_texture_destroy(struct wlr_texture *texture) {
wl_signal_emit_mutable(&texture->events.destroy, NULL);
if (texture && texture->impl && texture->impl->destroy) {
texture->impl->destroy(texture);
} else {