backend/headless: drop wlr_headless_backend_create_with_renderer
The headless backend no longer needs a parent renderer: it no longer needs to return it in wlr_backend_impl.get_renderer, nor does it need to return its DRM FD in wlr_backend_impl.get_drm_fd. Drop this function altogether since it now behaves exactly like wlr_headless_backend_create.
This commit is contained in:
parent
2e33139ef7
commit
b234edcf58
|
@ -78,20 +78,6 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
|
||||||
backend_destroy(&backend->backend);
|
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) {
|
struct wlr_backend *wlr_headless_backend_create(struct wl_display *display) {
|
||||||
wlr_log(WLR_INFO, "Creating headless backend");
|
wlr_log(WLR_INFO, "Creating headless backend");
|
||||||
|
|
||||||
|
@ -102,29 +88,14 @@ struct wlr_backend *wlr_headless_backend_create(struct wl_display *display) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!backend_init(backend, display)) {
|
wlr_backend_init(&backend->backend, &backend_impl);
|
||||||
free(backend);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return &backend->backend;
|
backend->display = display;
|
||||||
}
|
wl_list_init(&backend->outputs);
|
||||||
|
wl_list_init(&backend->input_devices);
|
||||||
|
|
||||||
struct wlr_backend *wlr_headless_backend_create_with_renderer(
|
backend->display_destroy.notify = handle_display_destroy;
|
||||||
struct wl_display *display, struct wlr_renderer *renderer) {
|
wl_display_add_destroy_listener(display, &backend->display_destroy);
|
||||||
wlr_log(WLR_INFO, "Creating headless backend with parent renderer");
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!backend_init(backend, display)) {
|
|
||||||
free(backend);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return &backend->backend;
|
return &backend->backend;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,11 +18,6 @@
|
||||||
* default.
|
* default.
|
||||||
*/
|
*/
|
||||||
struct wlr_backend *wlr_headless_backend_create(struct wl_display *display);
|
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
|
* 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
|
* read pixels from this framebuffer via wlr_renderer_read_pixels but it is
|
||||||
|
|
Loading…
Reference in New Issue