evas egl - esnure we always destroy surfaces because creating new ones

be sure we dont leak them.
This commit is contained in:
Carsten Haitzler 2019-08-07 16:59:43 +01:00
parent 8e67e9d18e
commit 064b46b7a3
4 changed files with 8 additions and 0 deletions

View File

@ -296,6 +296,8 @@ _evas_outbuf_egl_setup(Outbuf *ob)
ob->egl.config = cfgs[0];
EGLNativeWindowType win = create_hwcomposernativewindow();
if (ob->egl.surface[0] != EGL_NO_SURFACE)
eglDestroySurface(ob->egl.disp, ob->egl.surface[0]);
ob->egl.surface[0] =
eglCreateWindowSurface(ob->egl.disp, ob->egl.config,
(EGLNativeWindowType)win, NULL);

View File

@ -502,6 +502,8 @@ evas_outbuf_resurf(Outbuf *ob)
if (ob->surf) return;
if (getenv("EVAS_GL_INFO")) printf("resurf %p\n", ob);
if (ob->egl.surface != EGL_NO_SURFACE)
eglDestroySurface(ob->egl.disp, ob->egl.surface);
ob->egl.surface =
eglCreateWindowSurface(ob->egl.disp, ob->egl.config,
(EGLNativeWindowType)ob->surface, NULL);

View File

@ -824,6 +824,8 @@ eng_window_resurf(Outbuf *gw)
if (gw->surf) return;
if (getenv("EVAS_GL_INFO")) printf("resurf %p\n", gw);
#ifdef GL_GLES
if (gw->egl_surface)
eglDestroySurface(gw->egl_disp, gw->egl_surface);
gw->egl_surface = eglCreateWindowSurface(gw->egl_disp, gw->egl_config,
(EGLNativeWindowType)gw->win,
NULL);

View File

@ -339,6 +339,8 @@ eng_window_resurf(Outbuf *gw)
gw->win = wl_egl_window_create(wls, gw->h, gw->w);
}
if (gw->egl_surface != EGL_NO_SURFACE)
eglDestroySurface(gw->egl_disp, gw->egl_surface);
gw->egl_surface =
eglCreateWindowSurface(gw->egl_disp, gw->egl_config,
(EGLNativeWindowType)gw->win, NULL);