From 0c76aef2022525e9346b59596b5fa6e08b462998 Mon Sep 17 00:00:00 2001 From: Simon Zeni Date: Mon, 15 Nov 2021 12:10:57 -0500 Subject: backend: remove backend ensure renderer and allocator check --- backend/backend.c | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) (limited to 'backend') 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 -- cgit v1.2.3