summaryrefslogtreecommitdiff
path: root/src/lib/efl_wl
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2018-01-24 16:15:24 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2018-01-24 16:18:51 -0500
commit6e4c3b04458052ab94b7b358074a6df9cdd1479d (patch)
treeb131fb7f233c5d6068e768d19681301edf2e243d /src/lib/efl_wl
parent093aecd75e94b82f8d91dd267b3a072713aad7a4 (diff)
efl-wl: use image border to optimize surface rendering with 1 opaque rect
Diffstat (limited to 'src/lib/efl_wl')
-rw-r--r--src/lib/efl_wl/efl_wl.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/lib/efl_wl/efl_wl.c b/src/lib/efl_wl/efl_wl.c
index e02ac6787a..d6622ef8dd 100644
--- a/src/lib/efl_wl/efl_wl.c
+++ b/src/lib/efl_wl/efl_wl.c
@@ -1494,13 +1494,8 @@ comp_surface_commit_state(Comp_Surface *cs, Comp_Buffer_State *state)
1494 if (state->set_opaque && (!eina_tiler_equal(cs->opaque, state->opaque))) 1494 if (state->set_opaque && (!eina_tiler_equal(cs->opaque, state->opaque)))
1495 { 1495 {
1496 array_clear(&cs->opaque_rects); 1496 array_clear(&cs->opaque_rects);
1497 if (eina_tiler_empty(state->opaque)) 1497 if (!eina_tiler_empty(state->opaque))
1498 { 1498 /* FIXME: proxied opaque regions */
1499 evas_object_image_border_set(cs->img, 0, 0, 0, 0);
1500 EINA_LIST_FOREACH(cs->proxies, l, o)
1501 evas_object_image_border_set(o, 0, 0, 0, 0);
1502 }
1503 else /* FIXME: proxied opaque regions */
1504 { 1499 {
1505 Eina_Iterator *it; 1500 Eina_Iterator *it;
1506 Eina_Rectangle *rect; 1501 Eina_Rectangle *rect;
@@ -4152,6 +4147,21 @@ comp_render_pre(Comp *c, Evas *e EINA_UNUSED, void *event_info EINA_UNUSED)
4152 //if (cs->proxies) fprintf(stderr, "RENDER %d\n", wl_resource_get_id(buffer->res)); 4147 //if (cs->proxies) fprintf(stderr, "RENDER %d\n", wl_resource_get_id(buffer->res));
4153 cs->post_render_queue = 1; 4148 cs->post_render_queue = 1;
4154 4149
4150 if (cs->opaque_rects && (eina_array_count(cs->opaque_rects) == 1))
4151 {
4152 Evas_Object *r = eina_array_data_get(cs->opaque_rects, 0);
4153 int x, y, w, h, ox, oy, ow, oh;
4154
4155 evas_object_geometry_get(cs->img, &x, &y, &w, &h);
4156 evas_object_geometry_get(r, &ox, &oy, &ow, &oh);
4157 evas_object_image_border_set(cs->img, ox - x, ox + ow, oy - y, oy + oh);
4158 evas_object_image_border_center_fill_set(cs->img, EVAS_BORDER_FILL_SOLID);
4159 }
4160 else
4161 {
4162 evas_object_image_border_set(cs->img, 0, 0, 0, 0);
4163 evas_object_image_border_center_fill_set(cs->img, EVAS_BORDER_FILL_DEFAULT);
4164 }
4155 evas_object_image_alpha_set(cs->img, comp_surface_is_alpha(cs, buffer)); 4165 evas_object_image_alpha_set(cs->img, comp_surface_is_alpha(cs, buffer));
4156 evas_object_resize(cs->img, buffer->w, buffer->h); 4166 evas_object_resize(cs->img, buffer->w, buffer->h);
4157 evas_object_image_size_set(cs->img, buffer->w, buffer->h); 4167 evas_object_image_size_set(cs->img, buffer->w, buffer->h);