aboutsummaryrefslogtreecommitdiff
path: root/backend/headless
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2021-01-14 12:45:07 +0100
committerSimon Ser <contact@emersion.fr>2021-01-16 09:06:17 +0100
commitafdf4dc890d512b4d56796451af5a76a18376c0e (patch)
treef84b567ad6f70f98eca9834a9123f9ea61555ffd /backend/headless
parent08a4c62aac9d9771197018a155a9d80d6f93d764 (diff)
render/gles2: make EGL context current in bind_buffer
Instead of requiring callers to manually make the EGL context current before binding a buffer and unsetting it after unbinding a buffer, do it inside wlr_renderer_bind_buffer. This hides renderer-specific implementation details inside the wlr_renderer interface. Non-GLES2 renderers may not use EGL. This removes all EGL dependencies from the backends. References: https://github.com/swaywm/wlroots/issues/2618 References: https://github.com/swaywm/wlroots/pull/2615#issuecomment-756687006
Diffstat (limited to 'backend/headless')
-rw-r--r--backend/headless/output.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/backend/headless/output.c b/backend/headless/output.c
index 65727200..abd1ac45 100644
--- a/backend/headless/output.c
+++ b/backend/headless/output.c
@@ -2,8 +2,6 @@
#include <stdlib.h>
#include <stdio.h>
#include <wlr/interfaces/wlr_output.h>
-#include <wlr/render/egl.h>
-#include <wlr/render/gles2.h>
#include <wlr/render/wlr_renderer.h>
#include <wlr/util/log.h>
#include "backend/headless.h"
@@ -44,8 +42,6 @@ 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);
@@ -53,9 +49,6 @@ static bool output_attach_render(struct wlr_output *wlr_output,
return false;
}
- if (!wlr_egl_make_current(egl)) {
- return false;
- }
if (!wlr_renderer_bind_buffer(output->backend->renderer,
output->back_buffer)) {
return false;
@@ -102,10 +95,6 @@ static bool output_commit(struct wlr_output *wlr_output) {
wlr_renderer_bind_buffer(output->backend->renderer, NULL);
- 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;
break;
@@ -129,12 +118,8 @@ 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);
- 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(egl);
wlr_buffer_unlock(output->back_buffer);
output->back_buffer = NULL;