forked from enlightenment/efl
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:
parent
11e82fd7f4
commit
6c084b19b0
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue