aboutsummaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2021-01-09 12:13:35 +0100
committerSimon Ser <contact@emersion.fr>2021-01-12 11:31:04 +0100
commit3f7e0cf5f073ef7ef88128e8661b959cc9140490 (patch)
tree6f858fae4878056ada680d36a8f18a3b6a99ff0d /render
parent1d461687d24856a15fd8c37f744f40730888c9b0 (diff)
render/egl: remove surface and buffer age args from make_current
These aren't used anymore.
Diffstat (limited to 'render')
-rw-r--r--render/egl.c31
-rw-r--r--render/gles2/renderer.c8
-rw-r--r--render/gles2/texture.c8
3 files changed, 12 insertions, 35 deletions
diff --git a/render/egl.c b/render/egl.c
index 8cf20ece..1c986e47 100644
--- a/render/egl.c
+++ b/render/egl.c
@@ -220,9 +220,6 @@ struct wlr_egl *wlr_egl_create(EGLenum platform, void *remote_display,
load_egl_proc(&egl->procs.eglDestroyImageKHR, "eglDestroyImageKHR");
}
- egl->exts.buffer_age_ext =
- check_egl_ext(display_exts_str, "EGL_EXT_buffer_age");
-
egl->exts.image_dmabuf_import_ext =
check_egl_ext(display_exts_str, "EGL_EXT_image_dma_buf_import");
if (check_egl_ext(display_exts_str,
@@ -414,32 +411,12 @@ EGLSurface wlr_egl_create_surface(struct wlr_egl *egl, void *window) {
return surf;
}
-static int egl_get_buffer_age(struct wlr_egl *egl, EGLSurface surface) {
- if (!egl->exts.buffer_age_ext) {
- return -1;
- }
-
- EGLint buffer_age;
- EGLBoolean ok = eglQuerySurface(egl->display, surface,
- EGL_BUFFER_AGE_EXT, &buffer_age);
- if (!ok) {
- wlr_log(WLR_ERROR, "Failed to get EGL surface buffer age");
- return -1;
- }
-
- return buffer_age;
-}
-
-bool wlr_egl_make_current(struct wlr_egl *egl, EGLSurface surface,
- int *buffer_age) {
- if (!eglMakeCurrent(egl->display, surface, surface, egl->context)) {
+bool wlr_egl_make_current(struct wlr_egl *egl) {
+ if (!eglMakeCurrent(egl->display, EGL_NO_SURFACE, EGL_NO_SURFACE,
+ egl->context)) {
wlr_log(WLR_ERROR, "eglMakeCurrent failed");
return false;
}
-
- if (buffer_age != NULL) {
- *buffer_age = egl_get_buffer_age(egl, surface);
- }
return true;
}
@@ -751,7 +728,7 @@ bool wlr_egl_destroy_surface(struct wlr_egl *egl, EGLSurface surface) {
// Reset the current EGL surface in case it's the one we're destroying,
// otherwise the next wlr_egl_make_current call will result in a
// use-after-free.
- wlr_egl_make_current(egl, EGL_NO_SURFACE, NULL);
+ wlr_egl_make_current(egl);
}
return eglDestroySurface(egl->display, surface);
}
diff --git a/render/gles2/renderer.c b/render/gles2/renderer.c
index 5474e1b6..428fcd95 100644
--- a/render/gles2/renderer.c
+++ b/render/gles2/renderer.c
@@ -41,7 +41,7 @@ static void destroy_buffer(struct wlr_gles2_buffer *buffer) {
wl_list_remove(&buffer->link);
wl_list_remove(&buffer->buffer_destroy.link);
- wlr_egl_make_current(buffer->renderer->egl, EGL_NO_SURFACE, NULL);
+ wlr_egl_make_current(buffer->renderer->egl);
push_gles2_debug(buffer->renderer);
@@ -575,7 +575,7 @@ static bool gles2_blit_dmabuf(struct wlr_renderer *wlr_renderer,
gles2_src_tex->inverted_y = !gles2_src_tex->inverted_y;
}
- if (!wlr_egl_make_current(renderer->egl, EGL_NO_SURFACE, NULL)) {
+ if (!wlr_egl_make_current(renderer->egl)) {
goto texture_destroy_out;
}
@@ -673,7 +673,7 @@ struct wlr_egl *wlr_gles2_renderer_get_egl(struct wlr_renderer *wlr_renderer) {
static void gles2_destroy(struct wlr_renderer *wlr_renderer) {
struct wlr_gles2_renderer *renderer = gles2_get_renderer(wlr_renderer);
- wlr_egl_make_current(renderer->egl, EGL_NO_SURFACE, NULL);
+ wlr_egl_make_current(renderer->egl);
struct wlr_gles2_buffer *buffer, *buffer_tmp;
wl_list_for_each_safe(buffer, buffer_tmp, &renderer->buffers, link) {
@@ -861,7 +861,7 @@ extern const GLchar tex_fragment_src_rgbx[];
extern const GLchar tex_fragment_src_external[];
struct wlr_renderer *wlr_gles2_renderer_create(struct wlr_egl *egl) {
- if (!wlr_egl_make_current(egl, EGL_NO_SURFACE, NULL)) {
+ if (!wlr_egl_make_current(egl)) {
return NULL;
}
diff --git a/render/gles2/texture.c b/render/gles2/texture.c
index ea3a1161..9f886391 100644
--- a/render/gles2/texture.c
+++ b/render/gles2/texture.c
@@ -29,7 +29,7 @@ struct wlr_gles2_texture *gles2_get_texture(
static struct wlr_gles2_texture *get_gles2_texture_in_context(
struct wlr_texture *wlr_texture) {
struct wlr_gles2_texture *texture = gles2_get_texture(wlr_texture);
- wlr_egl_make_current(texture->renderer->egl, EGL_NO_SURFACE, NULL);
+ wlr_egl_make_current(texture->renderer->egl);
return texture;
}
@@ -138,7 +138,7 @@ struct wlr_texture *gles2_texture_from_pixels(struct wlr_renderer *wlr_renderer,
uint32_t height, const void *data) {
struct wlr_gles2_renderer *renderer = gles2_get_renderer(wlr_renderer);
- wlr_egl_make_current(renderer->egl, EGL_NO_SURFACE, NULL);
+ wlr_egl_make_current(renderer->egl);
const struct wlr_gles2_pixel_format *fmt = get_gles2_format_from_wl(wl_fmt);
if (fmt == NULL) {
@@ -180,7 +180,7 @@ struct wlr_texture *gles2_texture_from_wl_drm(struct wlr_renderer *wlr_renderer,
struct wl_resource *resource) {
struct wlr_gles2_renderer *renderer = gles2_get_renderer(wlr_renderer);
- wlr_egl_make_current(renderer->egl, EGL_NO_SURFACE, NULL);
+ wlr_egl_make_current(renderer->egl);
if (!renderer->procs.glEGLImageTargetTexture2DOES) {
return NULL;
@@ -245,7 +245,7 @@ struct wlr_texture *gles2_texture_from_dmabuf(struct wlr_renderer *wlr_renderer,
struct wlr_dmabuf_attributes *attribs) {
struct wlr_gles2_renderer *renderer = gles2_get_renderer(wlr_renderer);
- wlr_egl_make_current(renderer->egl, EGL_NO_SURFACE, NULL);
+ wlr_egl_make_current(renderer->egl);
if (!renderer->procs.glEGLImageTargetTexture2DOES) {
return NULL;