diff options
author | Simon Zeni <simon@bl4ckb0ne.ca> | 2021-11-15 13:24:55 -0500 |
---|---|---|
committer | Simon Zeni <simon@bl4ckb0ne.ca> | 2021-11-18 09:37:57 -0500 |
commit | a1430933392aabc25040cb22e6e4a0d6517b39b5 (patch) | |
tree | 3c8a4f455d017949148e418e0043ab57a3ca3a88 /backend/headless | |
parent | 5f111986056ff398e72d819481b6270c2b6dcbf6 (diff) |
backend/headless: don't store the parent renderer
Diffstat (limited to 'backend/headless')
-rw-r--r-- | backend/headless/backend.c | 39 |
1 files changed, 3 insertions, 36 deletions
diff --git a/backend/headless/backend.c b/backend/headless/backend.c index 49c2c8ba..886be276 100644 --- a/backend/headless/backend.c +++ b/backend/headless/backend.c @@ -51,7 +51,6 @@ static void backend_destroy(struct wlr_backend *wlr_backend) { } wl_list_remove(&backend->display_destroy.link); - wl_list_remove(&backend->parent_renderer_destroy.link); struct wlr_headless_output *output, *output_tmp; wl_list_for_each_safe(output, output_tmp, &backend->outputs, link) { @@ -70,17 +69,6 @@ static void backend_destroy(struct wlr_backend *wlr_backend) { free(backend); } -static struct wlr_renderer *backend_get_renderer( - struct wlr_backend *wlr_backend) { - struct wlr_headless_backend *backend = - headless_backend_from_backend(wlr_backend); - if (backend->parent_renderer != NULL) { - return backend->parent_renderer; - } else { - return wlr_backend->renderer; - } -} - static int backend_get_drm_fd(struct wlr_backend *wlr_backend) { struct wlr_headless_backend *backend = headless_backend_from_backend(wlr_backend); @@ -96,7 +84,6 @@ static uint32_t get_buffer_caps(struct wlr_backend *wlr_backend) { static const struct wlr_backend_impl backend_impl = { .start = backend_start, .destroy = backend_destroy, - .get_renderer = backend_get_renderer, .get_drm_fd = backend_get_drm_fd, .get_buffer_caps = get_buffer_caps, }; @@ -107,33 +94,13 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) { backend_destroy(&backend->backend); } -static void handle_renderer_destroy(struct wl_listener *listener, void *data) { - struct wlr_headless_backend *backend = - wl_container_of(listener, backend, parent_renderer_destroy); - backend_destroy(&backend->backend); -} - static bool backend_init(struct wlr_headless_backend *backend, - struct wl_display *display, struct wlr_renderer *renderer) { + 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); - wl_list_init(&backend->parent_renderer_destroy.link); - - if (renderer == NULL) { - renderer = wlr_renderer_autocreate(&backend->backend); - if (!renderer) { - wlr_log(WLR_ERROR, "Failed to create renderer"); - return false; - } - backend->backend.renderer = renderer; - } else { - backend->parent_renderer = renderer; - backend->parent_renderer_destroy.notify = handle_renderer_destroy; - wl_signal_add(&renderer->events.destroy, &backend->parent_renderer_destroy); - } backend->display_destroy.notify = handle_display_destroy; wl_display_add_destroy_listener(display, &backend->display_destroy); @@ -202,7 +169,7 @@ struct wlr_backend *wlr_headless_backend_create(struct wl_display *display) { wlr_log(WLR_ERROR, "Failed to open DRM render node"); } - if (!backend_init(backend, display, NULL)) { + if (!backend_init(backend, display)) { goto error_init; } @@ -236,7 +203,7 @@ struct wlr_backend *wlr_headless_backend_create_with_renderer( } } - if (!backend_init(backend, display, renderer)) { + if (!backend_init(backend, display)) { goto error_init; } |