mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-04 20:55:58 +01:00
backend: remove backend ensure renderer and allocator check
This commit is contained in:
parent
a6538ced35
commit
0c76aef202
1 changed files with 4 additions and 19 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue