From 6dc6af1534534394e62761bda7c7dbf01aaa3144 Mon Sep 17 00:00:00 2001 From: Simon Zeni Date: Tue, 16 Nov 2021 09:26:44 -0500 Subject: [PATCH] backend: remove backend_get_allocator --- backend/backend.c | 18 ------------------ include/backend/backend.h | 6 ------ include/wlr/backend.h | 1 - 3 files changed, 25 deletions(-) diff --git a/backend/backend.c b/backend/backend.c index 16ad309f..634e53b6 100644 --- a/backend/backend.c +++ b/backend/backend.c @@ -45,7 +45,6 @@ void wlr_backend_init(struct wlr_backend *backend, void wlr_backend_finish(struct wlr_backend *backend) { wlr_signal_emit_safe(&backend->events.destroy, backend); - wlr_allocator_destroy(backend->allocator); if (backend->has_own_renderer) { wlr_renderer_destroy(backend->renderer); } @@ -175,23 +174,6 @@ uint32_t backend_get_buffer_caps(struct wlr_backend *backend) { return backend->impl->get_buffer_caps(backend); } -struct wlr_allocator *backend_get_allocator(struct wlr_backend *backend) { - if (backend->allocator != NULL) { - return backend->allocator; - } - - struct wlr_renderer *renderer = wlr_backend_get_renderer(backend); - if (renderer == NULL) { - return NULL; - } - - backend->allocator = wlr_allocator_autocreate(backend, renderer); - if (backend->allocator == NULL) { - wlr_log(WLR_ERROR, "Failed to create backend allocator"); - } - return backend->allocator; -} - static size_t parse_outputs_env(const char *name) { const char *outputs_str = getenv(name); if (outputs_str == NULL) { diff --git a/include/backend/backend.h b/include/backend/backend.h index 7d88cd79..8c7440c3 100644 --- a/include/backend/backend.h +++ b/include/backend/backend.h @@ -10,10 +10,4 @@ */ uint32_t backend_get_buffer_caps(struct wlr_backend *backend); -/** - * Get the backend's allocator. Automatically creates the allocator if - * necessary. - */ -struct wlr_allocator *backend_get_allocator(struct wlr_backend *backend); - #endif diff --git a/include/wlr/backend.h b/include/wlr/backend.h index d616fa1d..9da84039 100644 --- a/include/wlr/backend.h +++ b/include/wlr/backend.h @@ -30,7 +30,6 @@ struct wlr_backend { bool has_own_renderer; struct wlr_renderer *renderer; - struct wlr_allocator *allocator; }; /**