diff options
author | Derek Foreman <derekf@osg.samsung.com> | 2016-08-19 14:22:46 -0500 |
---|---|---|
committer | Derek Foreman <derekf@osg.samsung.com> | 2016-08-19 15:48:02 -0500 |
commit | 32f6b1a768678509d03ce4ca6e2fa39944c860a5 (patch) | |
tree | bb535d35ff77183af28579d85677a8830321b01b | |
parent | 8e6330edc3c99ef37f833ca7e856dfea44c4f20d (diff) | |
download | efl-devs/derekf/damage.tar.gz |
ee_wayland_egl: Fix EGL_KHR_Partial_Update usagedevs/derekf/damage
Use the new damage region set callback to do partial updates that actually
work. Fixes gl rendering on mali.
@fix
-rw-r--r-- | src/modules/evas/engines/wayland_egl/evas_wl_main.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/src/modules/evas/engines/wayland_egl/evas_wl_main.c b/src/modules/evas/engines/wayland_egl/evas_wl_main.c index 710202f71a..b265d7f423 100644 --- a/src/modules/evas/engines/wayland_egl/evas_wl_main.c +++ b/src/modules/evas/engines/wayland_egl/evas_wl_main.c @@ -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 ((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; + if (glsym_eglSetDamageRegionKHR) + { + Tilebuf_Rect *tr; + int *rect, *rects, count; - _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; |