summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzmike <michael.blumenkrantz@gmail.com>2014-05-22 13:39:14 -0400
committerMike Blumenkrantz <zmike@samsung.com>2014-05-26 08:53:56 -0400
commitc625279a85858f64a1c1e4deb3bfec9e63effc7e (patch)
tree15b579f80940b9e64f3acf9cf719e197b01b4115
parent736b02cd22679e5e3b9e69ee2f71a40026555a17 (diff)
recursively hide edje group objects on edje hide
this massively improves edje performance when using groups, which previously would continue calculating their parts even when their parent object was hidden CPU usage in my test case went from 20-30% to 1%. @fix
-rw-r--r--src/lib/edje/edje_calc.c2
-rw-r--r--src/lib/edje/edje_load.c4
-rw-r--r--src/lib/edje/edje_smart.c20
3 files changed, 22 insertions, 4 deletions
diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c
index 00c25db3ce..2419e61181 100644
--- a/src/lib/edje/edje_calc.c
+++ b/src/lib/edje/edje_calc.c
@@ -3907,7 +3907,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta
3907 eo_do(ep->typedata.swallow->swallowed_object, 3907 eo_do(ep->typedata.swallow->swallowed_object,
3908 evas_obj_position_set(ed->x + pf->final.x, ed->y + pf->final.y), 3908 evas_obj_position_set(ed->x + pf->final.x, ed->y + pf->final.y),
3909 evas_obj_size_set(pf->final.w, pf->final.h), 3909 evas_obj_size_set(pf->final.w, pf->final.h),
3910 evas_obj_visibility_set(EINA_TRUE)); 3910 evas_obj_visibility_set(evas_object_visible_get(ed->obj)));
3911 } 3911 }
3912 else evas_object_hide(ep->typedata.swallow->swallowed_object); 3912 else evas_object_hide(ep->typedata.swallow->swallowed_object);
3913 mo = ep->typedata.swallow->swallowed_object; 3913 mo = ep->typedata.swallow->swallowed_object;
diff --git a/src/lib/edje/edje_load.c b/src/lib/edje/edje_load.c
index e43c8f1e0d..eb2f40b80e 100644
--- a/src/lib/edje/edje_load.c
+++ b/src/lib/edje/edje_load.c
@@ -940,7 +940,9 @@ _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const ch
940 obj); 940 obj);
941 if (rp->part->type == EDJE_PART_TYPE_GROUP) 941 if (rp->part->type == EDJE_PART_TYPE_GROUP)
942 { 942 {
943 ed->groups = eina_list_append(ed->groups, _edje_fetch(child_obj)); 943 Edje *edg = _edje_fetch(child_obj);
944 ed->groups = eina_list_append(ed->groups, edg);
945 evas_object_data_set(child_obj, "\377 edje.part_obj", rp);
944 _edje_real_part_swallow(ed, rp, child_obj, EINA_TRUE); 946 _edje_real_part_swallow(ed, rp, child_obj, EINA_TRUE);
945 _edje_subobj_register(ed, child_obj); 947 _edje_subobj_register(ed, child_obj);
946 source = NULL; 948 source = NULL;
diff --git a/src/lib/edje/edje_smart.c b/src/lib/edje/edje_smart.c
index b14ba16b94..aaf19ec2bf 100644
--- a/src/lib/edje/edje_smart.c
+++ b/src/lib/edje/edje_smart.c
@@ -286,7 +286,8 @@ _edje_smart_resize(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
286static void 286static void
287_edje_smart_show(Eo *obj, void *_pd, va_list *list EINA_UNUSED) 287_edje_smart_show(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
288{ 288{
289 Edje *ed = _pd; 289 Edje *ed = _pd, *edg;
290 Eina_List *l;
290 291
291 eo_do_super(obj, MY_CLASS, evas_obj_smart_show()); 292 eo_do_super(obj, MY_CLASS, evas_obj_smart_show());
292 if (evas_object_visible_get(obj)) return; 293 if (evas_object_visible_get(obj)) return;
@@ -300,13 +301,26 @@ _edje_smart_show(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
300 _edje_lua_script_only_show(ed); 301 _edje_lua_script_only_show(ed);
301 return; 302 return;
302 } 303 }
304 if (eina_list_count(ed->groups) > 1)
305 {
306 EINA_LIST_FOREACH(ed->groups, l, edg)
307 {
308 Edje_Real_Part *rp;
309
310 if (edg == ed) continue;
311 rp = evas_object_data_get(edg->obj, "\377 edje.part_obj");
312 if (rp->chosen_description->visible)
313 evas_object_show(edg->obj);
314 }
315 }
303 _edje_emit(ed, "show", NULL); 316 _edje_emit(ed, "show", NULL);
304} 317}
305 318
306static void 319static void
307_edje_smart_hide(Eo *obj, void *_pd, va_list *list EINA_UNUSED) 320_edje_smart_hide(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
308{ 321{
309 Edje *ed = _pd; 322 Edje *ed = _pd, *edg;
323 Eina_List *l;
310 324
311 eo_do_super(obj, MY_CLASS, evas_obj_smart_hide()); 325 eo_do_super(obj, MY_CLASS, evas_obj_smart_hide());
312 if (!evas_object_visible_get(obj)) return; 326 if (!evas_object_visible_get(obj)) return;
@@ -320,6 +334,8 @@ _edje_smart_hide(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
320 _edje_lua_script_only_hide(ed); 334 _edje_lua_script_only_hide(ed);
321 return; 335 return;
322 } 336 }
337 EINA_LIST_FOREACH(ed->groups, l, edg)
338 if (edg != ed) evas_object_hide(edg->obj);
323 _edje_emit(ed, "hide", NULL); 339 _edje_emit(ed, "hide", NULL);
324} 340}
325 341