aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backend/headless/backend.c41
-rw-r--r--include/wlr/backend/headless.h5
2 files changed, 6 insertions, 40 deletions
diff --git a/backend/headless/backend.c b/backend/headless/backend.c
index 8d74287d..b7788105 100644
--- a/backend/headless/backend.c
+++ b/backend/headless/backend.c
@@ -78,20 +78,6 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
backend_destroy(&backend->backend);
}
-static bool backend_init(struct wlr_headless_backend *backend,
- struct wl_display *display) {
- wlr_backend_init(&backend->backend, &backend_impl);
-
- backend->display = display;
- wl_list_init(&backend->outputs);
- wl_list_init(&backend->input_devices);
-
- backend->display_destroy.notify = handle_display_destroy;
- wl_display_add_destroy_listener(display, &backend->display_destroy);
-
- return true;
-}
-
struct wlr_backend *wlr_headless_backend_create(struct wl_display *display) {
wlr_log(WLR_INFO, "Creating headless backend");
@@ -102,29 +88,14 @@ struct wlr_backend *wlr_headless_backend_create(struct wl_display *display) {
return NULL;
}
- if (!backend_init(backend, display)) {
- free(backend);
- return NULL;
- }
-
- return &backend->backend;
-}
-
-struct wlr_backend *wlr_headless_backend_create_with_renderer(
- struct wl_display *display, struct wlr_renderer *renderer) {
- wlr_log(WLR_INFO, "Creating headless backend with parent renderer");
+ wlr_backend_init(&backend->backend, &backend_impl);
- struct wlr_headless_backend *backend =
- calloc(1, sizeof(struct wlr_headless_backend));
- if (!backend) {
- wlr_log(WLR_ERROR, "Failed to allocate wlr_headless_backend");
- return NULL;
- }
+ backend->display = display;
+ wl_list_init(&backend->outputs);
+ wl_list_init(&backend->input_devices);
- if (!backend_init(backend, display)) {
- free(backend);
- return NULL;
- }
+ backend->display_destroy.notify = handle_display_destroy;
+ wl_display_add_destroy_listener(display, &backend->display_destroy);
return &backend->backend;
}
diff --git a/include/wlr/backend/headless.h b/include/wlr/backend/headless.h
index 3eb1677d..07dac9b8 100644
--- a/include/wlr/backend/headless.h
+++ b/include/wlr/backend/headless.h
@@ -19,11 +19,6 @@
*/
struct wlr_backend *wlr_headless_backend_create(struct wl_display *display);
/**
- * Creates a headless backend with an existing renderer.
- */
-struct wlr_backend *wlr_headless_backend_create_with_renderer(
- struct wl_display *display, struct wlr_renderer *renderer);
-/**
* Create a new headless output backed by an in-memory EGL framebuffer. You can
* read pixels from this framebuffer via wlr_renderer_read_pixels but it is
* otherwise not displayed.