diff options
author | Simon Zeni <simon@bl4ckb0ne.ca> | 2021-11-15 13:30:38 -0500 |
---|---|---|
committer | Simon Zeni <simon@bl4ckb0ne.ca> | 2021-11-18 09:37:57 -0500 |
commit | fdf3169b4185dad34b01b62762a0218f1412897f (patch) | |
tree | 1295e63ba724ba77c53379f3ead9ddd136ce60f1 | |
parent | d1ebd52ab28a4758d1760e2f50181474e7f49e2f (diff) |
backend: remove wlr_backend_get_renderer
-rw-r--r-- | backend/backend.c | 33 | ||||
-rw-r--r-- | include/wlr/backend.h | 9 | ||||
-rw-r--r-- | include/wlr/backend/interface.h | 1 |
3 files changed, 0 insertions, 43 deletions
diff --git a/backend/backend.c b/backend/backend.c index 634e53b6..cd96377b 100644 --- a/backend/backend.c +++ b/backend/backend.c @@ -45,9 +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); - if (backend->has_own_renderer) { - wlr_renderer_destroy(backend->renderer); - } } bool wlr_backend_start(struct wlr_backend *backend) { @@ -69,36 +66,6 @@ void wlr_backend_destroy(struct wlr_backend *backend) { } } -static bool backend_create_renderer(struct wlr_backend *backend) { - if (backend->renderer != NULL) { - return true; - } - - backend->renderer = wlr_renderer_autocreate(backend); - if (backend->renderer == NULL) { - return false; - } - - backend->has_own_renderer = true; - return true; -} - -struct wlr_renderer *wlr_backend_get_renderer(struct wlr_backend *backend) { - if (backend->impl->get_renderer) { - return backend->impl->get_renderer(backend); - } - if (backend_get_buffer_caps(backend) != 0) { - // If the backend is capable of presenting buffers, automatically create - // the renderer if necessary. - if (!backend_create_renderer(backend)) { - wlr_log(WLR_ERROR, "Failed to create backend renderer"); - return NULL; - } - return backend->renderer; - } - return NULL; -} - struct wlr_session *wlr_backend_get_session(struct wlr_backend *backend) { if (backend->impl->get_session) { return backend->impl->get_session(backend); diff --git a/include/wlr/backend.h b/include/wlr/backend.h index 9da84039..d781f74d 100644 --- a/include/wlr/backend.h +++ b/include/wlr/backend.h @@ -25,11 +25,6 @@ struct wlr_backend { /** Raised when new outputs are added, passed the wlr_output */ struct wl_signal new_output; } events; - - // Private state - - bool has_own_renderer; - struct wlr_renderer *renderer; }; /** @@ -50,10 +45,6 @@ bool wlr_backend_start(struct wlr_backend *backend); */ void wlr_backend_destroy(struct wlr_backend *backend); /** - * Obtains the wlr_renderer reference this backend is using. - */ -struct wlr_renderer *wlr_backend_get_renderer(struct wlr_backend *backend); -/** * Obtains the wlr_session reference from this backend if there is any. * Might return NULL for backends that don't use a session. */ diff --git a/include/wlr/backend/interface.h b/include/wlr/backend/interface.h index 529f8f87..f0cafb01 100644 --- a/include/wlr/backend/interface.h +++ b/include/wlr/backend/interface.h @@ -16,7 +16,6 @@ struct wlr_backend_impl { bool (*start)(struct wlr_backend *backend); void (*destroy)(struct wlr_backend *backend); - struct wlr_renderer *(*get_renderer)(struct wlr_backend *backend); struct wlr_session *(*get_session)(struct wlr_backend *backend); clockid_t (*get_presentation_clock)(struct wlr_backend *backend); int (*get_drm_fd)(struct wlr_backend *backend); |