evas - gl x11 - dont crearte eglimage multiple times in same frame

if we're rendering in multiple scissor regions/updates - dont create
the eglimage multiple times for each bind+pass - only once for that
frame.
This commit is contained in:
Carsten Haitzler 2021-09-06 13:29:31 +01:00
parent 11e82fd7f4
commit 6c084b19b0
4 changed files with 8 additions and 2 deletions

View File

@ -277,6 +277,8 @@ struct _Evas_Engine_GL_Context
int foc, z0, px, py;
RGBA_Draw_Context *dc;
unsigned long long frame_cnt;
Evas_GL_Shared *shared;
int flushnum;

View File

@ -1941,15 +1941,17 @@ _native_bind_cb(void *image)
#ifdef GL_GLES
if (n->ns_data.x11.surface)
{
if (n->ns_data.x11.multiple_buffer)
if ((n->frame_cnt != im->gc->frame_cnt) &&
(n->ns_data.x11.multiple_buffer))
{
EGLint err;
if (!glsym_evas_gl_common_eglDestroyImage)
{
ERR("Try eglDestroyImage()/eglCreateImage() on EGL with no support");
return;
}
n->frame_cnt = im->gc->frame_cnt;
glsym_evas_gl_common_eglDestroyImage(im->native.disp,
n->ns_data.x11.surface);
if ((err = eglGetError()) != EGL_SUCCESS)

View File

@ -1706,6 +1706,7 @@ eng_outbuf_flush(Outbuf *ob, Tilebuf_Rect *surface_damage EINA_UNUSED, Tilebuf_R
// clear out rects after swap as we may use them during swap
ob->frame_cnt++;
ob->gl_context->frame_cnt++;
end:
glsym_evas_gl_preload_render_unlock(eng_preload_make_current, ob);

View File

@ -49,6 +49,7 @@ typedef struct _Native Native;
struct _Native
{
Evas_Native_Surface ns;
unsigned long long frame_cnt;
union {
/* EVAS_NATIVE_SURFACE_X11 */
struct