aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
Diffstat (limited to 'backend')
-rw-r--r--backend/drm/drm.c4
-rw-r--r--backend/headless/output.c17
-rw-r--r--backend/wayland/output.c6
-rw-r--r--backend/x11/output.c4
4 files changed, 20 insertions, 11 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c
index 45e459d1..1286a17f 100644
--- a/backend/drm/drm.c
+++ b/backend/drm/drm.c
@@ -556,14 +556,14 @@ static bool drm_connector_commit(struct wlr_output *output) {
}
}
- wlr_egl_make_current(&drm->renderer.egl, EGL_NO_SURFACE, NULL);
+ wlr_egl_unset_current(&drm->renderer.egl);
return true;
}
static void drm_connector_rollback(struct wlr_output *output) {
struct wlr_drm_backend *drm = get_drm_backend_from_backend(output->backend);
- wlr_egl_make_current(&drm->renderer.egl, EGL_NO_SURFACE, NULL);
+ wlr_egl_unset_current(&drm->renderer.egl);
}
size_t drm_crtc_get_gamma_lut_size(struct wlr_drm_backend *drm,
diff --git a/backend/headless/output.c b/backend/headless/output.c
index dc0a1478..822afac9 100644
--- a/backend/headless/output.c
+++ b/backend/headless/output.c
@@ -35,6 +35,8 @@ static bool create_fbo(struct wlr_headless_output *output,
GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ wlr_egl_unset_current(output->backend->egl);
+
if (status != GL_FRAMEBUFFER_COMPLETE) {
wlr_log(WLR_ERROR, "Failed to create FBO");
return false;
@@ -52,6 +54,9 @@ static void destroy_fbo(struct wlr_headless_output *output) {
glDeleteFramebuffers(1, &output->fbo);
glDeleteRenderbuffers(1, &output->rbo);
+
+ wlr_egl_unset_current(output->backend->egl);
+
output->fbo = 0;
output->rbo = 0;
}
@@ -125,21 +130,23 @@ static bool output_commit(struct wlr_output *wlr_output) {
}
if (wlr_output->pending.committed & WLR_OUTPUT_STATE_BUFFER) {
+ glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ wlr_egl_unset_current(output->backend->egl);
+
// Nothing needs to be done for FBOs
wlr_output_send_present(wlr_output, NULL);
}
- wlr_egl_make_current(output->backend->egl, EGL_NO_SURFACE, NULL);
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
-
return true;
}
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);
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ if (wlr_output->pending.committed & WLR_OUTPUT_STATE_BUFFER) {
+ glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ wlr_egl_unset_current(output->backend->egl);
+ }
}
static void output_destroy(struct wlr_output *wlr_output) {
diff --git a/backend/wayland/output.c b/backend/wayland/output.c
index 077aa16d..7f4f083e 100644
--- a/backend/wayland/output.c
+++ b/backend/wayland/output.c
@@ -300,7 +300,7 @@ static bool output_commit(struct wlr_output *wlr_output) {
}
}
- wlr_egl_make_current(&output->backend->egl, EGL_NO_SURFACE, NULL);
+ wlr_egl_unset_current(&output->backend->egl);
return true;
}
@@ -308,7 +308,7 @@ static bool output_commit(struct wlr_output *wlr_output) {
static void output_rollback(struct wlr_output *wlr_output) {
struct wlr_wl_output *output =
get_wl_output_from_output(wlr_output);
- wlr_egl_make_current(&output->backend->egl, EGL_NO_SURFACE, NULL);
+ wlr_egl_unset_current(&output->backend->egl);
}
static bool output_set_cursor(struct wlr_output *wlr_output,
@@ -377,6 +377,7 @@ static bool output_set_cursor(struct wlr_output *wlr_output,
wlr_egl_swap_buffers(&backend->egl, egl_surface, NULL);
wlr_egl_destroy_surface(&backend->egl, egl_surface);
+ wlr_egl_unset_current(&backend->egl);
} else {
wl_surface_attach(surface, NULL, 0, 0);
wl_surface_commit(surface);
@@ -583,6 +584,7 @@ struct wlr_output *wlr_wl_output_create(struct wlr_backend *wlr_backend) {
NULL)) {
goto error;
}
+ wlr_egl_unset_current(&output->backend->egl);
wl_list_insert(&backend->outputs, &output->link);
wlr_output_update_enabled(wlr_output, true);
diff --git a/backend/x11/output.c b/backend/x11/output.c
index f2b90cd3..9366191c 100644
--- a/backend/x11/output.c
+++ b/backend/x11/output.c
@@ -157,14 +157,14 @@ static bool output_commit(struct wlr_output *wlr_output) {
wlr_output_send_present(wlr_output, NULL);
}
- wlr_egl_make_current(&x11->egl, EGL_NO_SURFACE, NULL);
+ wlr_egl_unset_current(&x11->egl);
return true;
}
static void output_rollback(struct wlr_output *wlr_output) {
struct wlr_x11_output *output = get_x11_output_from_output(wlr_output);
- wlr_egl_make_current(&output->x11->egl, EGL_NO_SURFACE, NULL);
+ wlr_egl_unset_current(&output->x11->egl);
}
static const struct wlr_output_impl output_impl = {