backend: remove wlr_egl from all backends

This commit is contained in:
Simon Zeni 2021-01-07 00:10:10 -05:00 committed by Simon Ser
parent 5773794baf
commit b899a412e3
14 changed files with 65 additions and 33 deletions

View file

@ -2,6 +2,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <wlr/interfaces/wlr_output.h>
#include <wlr/render/gles2.h>
#include <wlr/render/wlr_renderer.h>
#include <wlr/util/log.h>
#include "backend/headless.h"
@ -42,6 +43,8 @@ static bool output_attach_render(struct wlr_output *wlr_output,
int *buffer_age) {
struct wlr_headless_output *output =
headless_output_from_output(wlr_output);
struct wlr_egl *egl = wlr_gles2_renderer_get_egl(
output->backend->renderer);
wlr_buffer_unlock(output->back_buffer);
output->back_buffer = wlr_swapchain_acquire(output->swapchain, buffer_age);
@ -49,7 +52,7 @@ static bool output_attach_render(struct wlr_output *wlr_output,
return false;
}
if (!wlr_egl_make_current(output->backend->egl, EGL_NO_SURFACE, NULL)) {
if (!wlr_egl_make_current(egl, EGL_NO_SURFACE, NULL)) {
return false;
}
if (!wlr_renderer_bind_buffer(output->backend->renderer,
@ -97,7 +100,10 @@ static bool output_commit(struct wlr_output *wlr_output) {
assert(output->back_buffer != NULL);
wlr_renderer_bind_buffer(output->backend->renderer, NULL);
wlr_egl_unset_current(output->backend->egl);
struct wlr_egl *egl = wlr_gles2_renderer_get_egl(
output->backend->renderer);
wlr_egl_unset_current(egl);
buffer = output->back_buffer;
output->back_buffer = NULL;
@ -122,10 +128,12 @@ static bool output_commit(struct wlr_output *wlr_output) {
static void output_rollback_render(struct wlr_output *wlr_output) {
struct wlr_headless_output *output =
headless_output_from_output(wlr_output);
assert(wlr_egl_is_current(output->backend->egl));
struct wlr_egl *egl = wlr_gles2_renderer_get_egl(
output->backend->renderer);
assert(wlr_egl_is_current(egl));
wlr_renderer_bind_buffer(output->backend->renderer, NULL);
wlr_egl_unset_current(output->backend->egl);
wlr_egl_unset_current(egl);
wlr_buffer_unlock(output->back_buffer);
output->back_buffer = NULL;