|
|
@ -45,9 +45,6 @@ void wlr_backend_init(struct wlr_backend *backend,
|
|
|
|
|
|
|
|
|
|
|
|
void wlr_backend_finish(struct wlr_backend *backend) {
|
|
|
|
void wlr_backend_finish(struct wlr_backend *backend) {
|
|
|
|
wlr_signal_emit_safe(&backend->events.destroy, backend);
|
|
|
|
wlr_signal_emit_safe(&backend->events.destroy, backend);
|
|
|
|
if (backend->has_own_renderer) {
|
|
|
|
|
|
|
|
wlr_renderer_destroy(backend->renderer);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool wlr_backend_start(struct wlr_backend *backend) {
|
|
|
|
bool wlr_backend_start(struct wlr_backend *backend) {
|
|
|
@ -69,36 +66,6 @@ void wlr_backend_destroy(struct wlr_backend *backend) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static bool backend_create_renderer(struct wlr_backend *backend) {
|
|
|
|
|
|
|
|
if (backend->renderer != NULL) {
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
backend->renderer = wlr_renderer_autocreate(backend);
|
|
|
|
|
|
|
|
if (backend->renderer == NULL) {
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
backend->has_own_renderer = true;
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct wlr_renderer *wlr_backend_get_renderer(struct wlr_backend *backend) {
|
|
|
|
|
|
|
|
if (backend->impl->get_renderer) {
|
|
|
|
|
|
|
|
return backend->impl->get_renderer(backend);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (backend_get_buffer_caps(backend) != 0) {
|
|
|
|
|
|
|
|
// If the backend is capable of presenting buffers, automatically create
|
|
|
|
|
|
|
|
// the renderer if necessary.
|
|
|
|
|
|
|
|
if (!backend_create_renderer(backend)) {
|
|
|
|
|
|
|
|
wlr_log(WLR_ERROR, "Failed to create backend renderer");
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return backend->renderer;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct wlr_session *wlr_backend_get_session(struct wlr_backend *backend) {
|
|
|
|
struct wlr_session *wlr_backend_get_session(struct wlr_backend *backend) {
|
|
|
|
if (backend->impl->get_session) {
|
|
|
|
if (backend->impl->get_session) {
|
|
|
|
return backend->impl->get_session(backend);
|
|
|
|
return backend->impl->get_session(backend);
|
|
|
|