summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2016-08-19 14:22:46 -0500
committerDerek Foreman <derekf@osg.samsung.com>2016-08-19 16:26:32 -0500
commit0774088c90a5eb45367cb7dfef18b74e29b1b1dd (patch)
tree95e499b6f5da9e49f63d94dd7ec5b4a5ce615482
parent0c21a926a322f810352a654b82455a41e85f06b2 (diff)
downloadefl-0774088c90a5eb45367cb7dfef18b74e29b1b1dd.tar.gz
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
-rw-r--r--src/modules/evas/engines/wayland_egl/evas_engine.c2
-rw-r--r--src/modules/evas/engines/wayland_egl/evas_wl_main.c32
2 files changed, 18 insertions, 16 deletions
diff --git a/src/modules/evas/engines/wayland_egl/evas_engine.c b/src/modules/evas/engines/wayland_egl/evas_engine.c
index 157dd2d4fc..9d4260dfa1 100644
--- a/src/modules/evas/engines/wayland_egl/evas_engine.c
+++ b/src/modules/evas/engines/wayland_egl/evas_engine.c
@@ -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,
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;