mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-12-16 08:56:26 -05:00
backend: create renderer and allocator in wlr_backend_autocreate
Instead of ensuring the renderer and allocator are initialized in each backend, do it in wlr_backend_autocreate. This allows compositors to create backends without any renderer/allocator if they side-step wlr_backend_autocreate. Since the wlr_backend_get_renderer and backend_get_allocator end up calling wlr_renderer_autocreate and wlr_allocator_autocreate, it sounds like a good idea to centralize all of the opimionated bits in one place.
This commit is contained in:
parent
20d9448257
commit
3d0848daae
5 changed files with 19 additions and 35 deletions
|
|
@ -29,7 +29,6 @@
|
|||
#include <wlr/interfaces/wlr_pointer.h>
|
||||
#include <wlr/util/log.h>
|
||||
|
||||
#include "backend/backend.h"
|
||||
#include "backend/x11.h"
|
||||
#include "render/drm_format_set.h"
|
||||
#include "util/signal.h"
|
||||
|
|
@ -611,12 +610,6 @@ struct wlr_backend *wlr_x11_backend_create(struct wl_display *display,
|
|||
}
|
||||
}
|
||||
|
||||
struct wlr_renderer *renderer = wlr_backend_get_renderer(&x11->backend);
|
||||
struct wlr_allocator *allocator = backend_get_allocator(&x11->backend);
|
||||
if (renderer == NULL || allocator == NULL) {
|
||||
goto error_event;
|
||||
}
|
||||
|
||||
// Windows can only display buffers with the depth they were created with
|
||||
// TODO: look into changing the window's depth at runtime
|
||||
const struct wlr_drm_format *dri3_format =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue