aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authorSimon Zeni <simon@bl4ckb0ne.ca>2021-11-15 12:10:57 -0500
committerSimon Zeni <simon@bl4ckb0ne.ca>2021-11-18 09:37:57 -0500
commit0c76aef2022525e9346b59596b5fa6e08b462998 (patch)
tree639fb69e8f661cbdcc5c4ea2bf27a8fab81ad9fc /backend
parenta6538ced35872a86d37d6ca32b1d9ddb5fe2c4b7 (diff)
backend: remove backend ensure renderer and allocator check
Diffstat (limited to 'backend')
-rw-r--r--backend/backend.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/backend/backend.c b/backend/backend.c
index f8fa45c4..16ad309f 100644
--- a/backend/backend.c
+++ b/backend/backend.c
@@ -208,21 +208,6 @@ static size_t parse_outputs_env(const char *name) {
return outputs;
}
-static struct wlr_backend *ensure_backend_renderer_and_allocator(
- struct wlr_backend *backend) {
- struct wlr_renderer *renderer = wlr_backend_get_renderer(backend);
- if (renderer == NULL) {
- wlr_backend_destroy(backend);
- return NULL;
- }
- struct wlr_allocator *allocator = backend_get_allocator(backend);
- if (allocator == NULL) {
- wlr_backend_destroy(backend);
- return NULL;
- }
- return backend;
-}
-
static struct wlr_backend *attempt_wl_backend(struct wl_display *display) {
struct wlr_backend *backend = wlr_wl_backend_create(display, NULL);
if (backend == NULL) {
@@ -234,7 +219,7 @@ static struct wlr_backend *attempt_wl_backend(struct wl_display *display) {
wlr_wl_output_create(backend);
}
- return ensure_backend_renderer_and_allocator(backend);
+ return backend;
}
#if WLR_HAS_X11_BACKEND
@@ -250,7 +235,7 @@ static struct wlr_backend *attempt_x11_backend(struct wl_display *display,
wlr_x11_output_create(backend);
}
- return ensure_backend_renderer_and_allocator(backend);
+ return backend;
}
#endif
@@ -266,7 +251,7 @@ static struct wlr_backend *attempt_headless_backend(
wlr_headless_add_output(backend, 1280, 720);
}
- return ensure_backend_renderer_and_allocator(backend);
+ return backend;
}
static struct wlr_backend *attempt_noop_backend(struct wl_display *display) {
@@ -320,7 +305,7 @@ static struct wlr_backend *attempt_drm_backend(struct wl_display *display,
return NULL;
}
- return ensure_backend_renderer_and_allocator(primary_drm);
+ return backend;
}
#endif