mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-12-15 08:56:26 -05:00
backend/headless: add wlr_headless_backend_create_with_renderer
This allows one to create a headless backend with an existing renderer.
This commit is contained in:
parent
40513f1a0e
commit
6129a6f93e
4 changed files with 80 additions and 43 deletions
|
|
@ -16,7 +16,7 @@ static struct wlr_headless_output *headless_output_from_output(
|
|||
|
||||
static bool create_fbo(struct wlr_headless_output *output,
|
||||
unsigned int width, unsigned int height) {
|
||||
if (!wlr_egl_make_current(&output->backend->egl, EGL_NO_SURFACE, NULL)) {
|
||||
if (!wlr_egl_make_current(output->backend->egl, EGL_NO_SURFACE, NULL)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -46,7 +46,7 @@ static bool create_fbo(struct wlr_headless_output *output,
|
|||
}
|
||||
|
||||
static void destroy_fbo(struct wlr_headless_output *output) {
|
||||
if (!wlr_egl_make_current(&output->backend->egl, EGL_NO_SURFACE, NULL)) {
|
||||
if (!wlr_egl_make_current(output->backend->egl, EGL_NO_SURFACE, NULL)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -82,7 +82,7 @@ static bool output_attach_render(struct wlr_output *wlr_output,
|
|||
struct wlr_headless_output *output =
|
||||
headless_output_from_output(wlr_output);
|
||||
|
||||
if (!wlr_egl_make_current(&output->backend->egl, EGL_NO_SURFACE, NULL)) {
|
||||
if (!wlr_egl_make_current(output->backend->egl, EGL_NO_SURFACE, NULL)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -129,7 +129,7 @@ static bool output_commit(struct wlr_output *wlr_output) {
|
|||
wlr_output_send_present(wlr_output, NULL);
|
||||
}
|
||||
|
||||
wlr_egl_make_current(&output->backend->egl, EGL_NO_SURFACE, NULL);
|
||||
wlr_egl_make_current(output->backend->egl, EGL_NO_SURFACE, NULL);
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
|
||||
return true;
|
||||
|
|
@ -138,7 +138,7 @@ static bool output_commit(struct wlr_output *wlr_output) {
|
|||
static void output_rollback(struct wlr_output *wlr_output) {
|
||||
struct wlr_headless_output *output =
|
||||
headless_output_from_output(wlr_output);
|
||||
wlr_egl_make_current(&output->backend->egl, EGL_NO_SURFACE, NULL);
|
||||
wlr_egl_make_current(output->backend->egl, EGL_NO_SURFACE, NULL);
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue