|
|
@ -19,6 +19,7 @@
|
|
|
|
#include <wlr/util/log.h>
|
|
|
|
#include <wlr/util/log.h>
|
|
|
|
#include "backend/backend.h"
|
|
|
|
#include "backend/backend.h"
|
|
|
|
#include "backend/multi.h"
|
|
|
|
#include "backend/multi.h"
|
|
|
|
|
|
|
|
#include "render/allocator.h"
|
|
|
|
#include "util/signal.h"
|
|
|
|
#include "util/signal.h"
|
|
|
|
|
|
|
|
|
|
|
|
#if WLR_HAS_X11_BACKEND
|
|
|
|
#if WLR_HAS_X11_BACKEND
|
|
|
@ -36,6 +37,7 @@ 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);
|
|
|
|
|
|
|
|
wlr_allocator_destroy(backend->allocator);
|
|
|
|
wlr_renderer_destroy(backend->renderer);
|
|
|
|
wlr_renderer_destroy(backend->renderer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -116,6 +118,23 @@ uint32_t backend_get_buffer_caps(struct wlr_backend *backend) {
|
|
|
|
return backend->impl->get_buffer_caps(backend);
|
|
|
|
return backend->impl->get_buffer_caps(backend);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct wlr_allocator *backend_get_allocator(struct wlr_backend *backend) {
|
|
|
|
|
|
|
|
if (backend->allocator != NULL) {
|
|
|
|
|
|
|
|
return backend->allocator;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct wlr_renderer *renderer = wlr_backend_get_renderer(backend);
|
|
|
|
|
|
|
|
if (renderer == NULL) {
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
backend->allocator = wlr_allocator_autocreate(backend, renderer);
|
|
|
|
|
|
|
|
if (backend->allocator == NULL) {
|
|
|
|
|
|
|
|
wlr_log(WLR_ERROR, "Failed to create backend allocator");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return backend->allocator;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static size_t parse_outputs_env(const char *name) {
|
|
|
|
static size_t parse_outputs_env(const char *name) {
|
|
|
|
const char *outputs_str = getenv(name);
|
|
|
|
const char *outputs_str = getenv(name);
|
|
|
|
if (outputs_str == NULL) {
|
|
|
|
if (outputs_str == NULL) {
|
|
|
|