mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-12-15 08:56:26 -05:00
Destroy wlr_surface with wlr_renderer
This commit is contained in:
parent
d47713ac0f
commit
449f06556a
6 changed files with 33 additions and 12 deletions
|
|
@ -5,6 +5,7 @@
|
|||
#include <wlr/render/wlr_renderer.h>
|
||||
#include <wlr/types/wlr_matrix.h>
|
||||
#include <wlr/util/log.h>
|
||||
#include "util/signal.h"
|
||||
|
||||
void wlr_renderer_init(struct wlr_renderer *renderer,
|
||||
const struct wlr_renderer_impl *impl) {
|
||||
|
|
@ -18,9 +19,13 @@ void wlr_renderer_init(struct wlr_renderer *renderer,
|
|||
assert(impl->format_supported);
|
||||
assert(impl->texture_from_pixels);
|
||||
renderer->impl = impl;
|
||||
|
||||
wl_signal_init(&renderer->events.destroy);
|
||||
}
|
||||
|
||||
void wlr_renderer_destroy(struct wlr_renderer *r) {
|
||||
wlr_signal_emit_safe(&r->events.destroy, r);
|
||||
|
||||
if (r && r->impl && r->impl->destroy) {
|
||||
r->impl->destroy(r);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue