aboutsummaryrefslogtreecommitdiff
path: root/backend/x11
diff options
context:
space:
mode:
authorSimon Zeni <simon@bl4ckb0ne.ca>2021-01-07 00:10:10 -0500
committerSimon Ser <contact@emersion.fr>2021-01-07 17:11:22 +0100
commitb899a412e3eb7be76df495883de9aa2bdb3be06f (patch)
tree0858d2aedf0c252d40ab0964642f286fd1ccb931 /backend/x11
parent5773794baff0f1cf843f5585322834d050dd231b (diff)
backend: remove wlr_egl from all backends
Diffstat (limited to 'backend/x11')
-rw-r--r--backend/x11/backend.c3
-rw-r--r--backend/x11/output.c11
2 files changed, 9 insertions, 5 deletions
diff --git a/backend/x11/backend.c b/backend/x11/backend.c
index c16191f8..e8908e5b 100644
--- a/backend/x11/backend.c
+++ b/backend/x11/backend.c
@@ -181,7 +181,6 @@ static void backend_destroy(struct wlr_backend *backend) {
wl_list_remove(&x11->display_destroy.link);
wlr_renderer_destroy(x11->renderer);
- wlr_egl_finish(&x11->egl);
wlr_allocator_destroy(x11->allocator);
wlr_drm_format_set_finish(&x11->dri3_formats);
free(x11->drm_format);
@@ -535,7 +534,7 @@ struct wlr_backend *wlr_x11_backend_create(struct wl_display *display,
}
x11->allocator = &gbm_alloc->base;
- x11->renderer = wlr_renderer_autocreate(&x11->egl, EGL_PLATFORM_GBM_KHR,
+ x11->renderer = wlr_renderer_autocreate(EGL_PLATFORM_GBM_KHR,
gbm_alloc->gbm_device);
if (x11->renderer == NULL) {
wlr_log(WLR_ERROR, "Failed to create renderer");
diff --git a/backend/x11/output.c b/backend/x11/output.c
index 86729ace..4d764414 100644
--- a/backend/x11/output.c
+++ b/backend/x11/output.c
@@ -13,6 +13,7 @@
#include <wlr/interfaces/wlr_output.h>
#include <wlr/interfaces/wlr_pointer.h>
#include <wlr/interfaces/wlr_touch.h>
+#include <wlr/render/gles2.h>
#include <wlr/util/log.h>
#include "backend/x11.h"
@@ -97,6 +98,7 @@ static bool output_attach_render(struct wlr_output *wlr_output,
int *buffer_age) {
struct wlr_x11_output *output = get_x11_output_from_output(wlr_output);
struct wlr_x11_backend *x11 = output->x11;
+ struct wlr_egl *egl = wlr_gles2_renderer_get_egl(x11->renderer);
wlr_buffer_unlock(output->back_buffer);
output->back_buffer = wlr_swapchain_acquire(output->swapchain, buffer_age);
@@ -104,7 +106,7 @@ static bool output_attach_render(struct wlr_output *wlr_output,
return false;
}
- if (!wlr_egl_make_current(&x11->egl, EGL_NO_SURFACE, NULL)) {
+ if (!wlr_egl_make_current(egl, EGL_NO_SURFACE, NULL)) {
return false;
}
if (!wlr_renderer_bind_buffer(x11->renderer, output->back_buffer)) {
@@ -204,11 +206,12 @@ static struct wlr_x11_buffer *get_or_create_x11_buffer(
static bool output_commit_buffer(struct wlr_x11_output *output) {
struct wlr_x11_backend *x11 = output->x11;
+ struct wlr_egl *egl = wlr_gles2_renderer_get_egl(x11->renderer);
assert(output->back_buffer != NULL);
wlr_renderer_bind_buffer(x11->renderer, NULL);
- wlr_egl_unset_current(&x11->egl);
+ wlr_egl_unset_current(egl);
struct wlr_x11_buffer *x11_buffer =
get_or_create_x11_buffer(output, output->back_buffer);
@@ -315,8 +318,10 @@ static bool output_commit(struct wlr_output *wlr_output) {
static void output_rollback_render(struct wlr_output *wlr_output) {
struct wlr_x11_output *output = get_x11_output_from_output(wlr_output);
struct wlr_x11_backend *x11 = output->x11;
+ struct wlr_egl *egl = wlr_gles2_renderer_get_egl(x11->renderer);
+
wlr_renderer_bind_buffer(x11->renderer, NULL);
- wlr_egl_unset_current(&x11->egl);
+ wlr_egl_unset_current(egl);
}
static const struct wlr_output_impl output_impl = {