mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-17 06:46:39 -04:00
render/texture: add destroy event
This commit is contained in:
parent
0db8e14ce0
commit
4ccc774dbb
2 changed files with 7 additions and 0 deletions
|
|
@ -24,6 +24,10 @@ struct wlr_texture {
|
||||||
uint32_t width, height;
|
uint32_t width, height;
|
||||||
|
|
||||||
struct wlr_renderer *renderer;
|
struct wlr_renderer *renderer;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
struct wl_signal destroy;
|
||||||
|
} events;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct wlr_texture_read_pixels_options {
|
struct wlr_texture_read_pixels_options {
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,12 @@ void wlr_texture_init(struct wlr_texture *texture, struct wlr_renderer *renderer
|
||||||
.width = width,
|
.width = width,
|
||||||
.height = height,
|
.height = height,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
wl_signal_init(&texture->events.destroy);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wlr_texture_destroy(struct wlr_texture *texture) {
|
void wlr_texture_destroy(struct wlr_texture *texture) {
|
||||||
|
wl_signal_emit_mutable(&texture->events.destroy, NULL);
|
||||||
if (texture && texture->impl && texture->impl->destroy) {
|
if (texture && texture->impl && texture->impl->destroy) {
|
||||||
texture->impl->destroy(texture);
|
texture->impl->destroy(texture);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue