mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-31 22:25:21 -04:00
render/egl: remove surface and buffer age args from make_current
These aren't used anymore.
This commit is contained in:
parent
1d461687d2
commit
3f7e0cf5f0
8 changed files with 19 additions and 45 deletions
31
render/egl.c
31
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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue