wayland_egl: Fix EGL_KHR_Partial_Update usage

Use the new damage region set callback to do partial updates that actually
work.  Fixes gl rendering on mali.

@fix
This commit is contained in:
Derek Foreman 2016-08-19 14:22:46 -05:00
parent 0c21a926a3
commit 0774088c90
2 changed files with 18 additions and 16 deletions

View File

@ -591,7 +591,7 @@ eng_setup(Evas *evas, void *info)
eng_outbuf_rotation_get,
eng_outbuf_reconfigure,
eng_outbuf_region_first_rect,
NULL,
eng_outbuf_damage_region_set,
eng_outbuf_update_region_new,
eng_outbuf_update_region_push,
eng_outbuf_update_region_free,

View File

@ -384,11 +384,10 @@ eng_outbuf_swap_mode_get(Outbuf *ob)
if ((int)age != ob->prev_age) swap_mode = MODE_FULL;
ob->prev_age = age;
return swap_mode;
}
if (ob->swap_mode == MODE_AUTO) return MODE_FULL;
return ob->swap_mode;
}
@ -444,18 +443,24 @@ _convert_glcoords(int *result, Outbuf *ob, int x, int y, int w, int h)
}
}
static void
_damage_rect_set(Outbuf *ob, int x, int y, int w, int h)
void
eng_outbuf_damage_region_set(Outbuf *ob, Tilebuf_Rect *damage)
{
int rects[4];
if (glsym_eglSetDamageRegionKHR)
{
Tilebuf_Rect *tr;
int *rect, *rects, count;
if ((x == 0) && (y == 0) &&
(((w == ob->gl_context->w) && (h == ob->gl_context->h)) ||
((h == ob->gl_context->w) && (w == ob->gl_context->h))))
return;
_convert_glcoords(rects, ob, x, y, w, h);
glsym_eglSetDamageRegionKHR(ob->egl_disp, ob->egl_surface[0], rects, 1);
count = eina_inlist_count(EINA_INLIST_GET(damage));
rects = alloca(sizeof(int) * 4 * count);
rect = rects;
EINA_INLIST_FOREACH(damage, tr)
{
_convert_glcoords(rect, ob, tr->x, tr->y, tr->w, tr->h);
rect += 4;
}
glsym_eglSetDamageRegionKHR(ob->egl_disp, ob->egl_surface[0], rects, count);
}
}
void *
@ -470,9 +475,6 @@ eng_outbuf_update_region_new(Outbuf *ob, int x, int y, int w, int h, int *cx EIN
ob->gl_context->master_clip.y = y;
ob->gl_context->master_clip.w = w;
ob->gl_context->master_clip.h = h;
if (glsym_eglSetDamageRegionKHR)
_damage_rect_set(ob, x, y, w, h);
}
return ob->gl_context->def_surface;