summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2015-10-21 20:01:26 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2015-10-21 20:16:06 +0900
commitb7d2f4f81468b90a09c977dbefd6f75908719ab9 (patch)
tree3128a0f2889f9c5756ca32bc0da81a906852f8ca
parent84b6b4c0406b0ca3a2fe62aaffeb0467cb085bf7 (diff)
efl - edje - fix edje calc to avoid eo calls when object doesnt change
in many cases edje dumbly calls eo_do() or evas_object_xxxx on objects to set up their porperties when the part never uses that thing at al - eg filters. the obnject never had filters and will not have them n3ext - why always set filter to null every time? skip when not needed for speedups. so this fixes over-zealous calling whihc adds overhead that is not needed causing battery drain and cpu usage, heat creation etc. etc. @fix
-rw-r--r--src/lib/edje/edje_calc.c41
1 files changed, 26 insertions, 15 deletions
diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c
index 817677c2d2..763c67b3a6 100644
--- a/src/lib/edje/edje_calc.c
+++ b/src/lib/edje/edje_calc.c
@@ -2454,7 +2454,7 @@ _edje_part_recalc_single_filter(Edje *ed,
2454 Edje_Part_Description_Common *chosen_desc, 2454 Edje_Part_Description_Common *chosen_desc,
2455 double pos) 2455 double pos)
2456{ 2456{
2457 Edje_Part_Description_Spec_Filter *filter; 2457 Edje_Part_Description_Spec_Filter *filter, *prevfilter;
2458 Eina_List *filter_sources = NULL, *prev_sources = NULL; 2458 Eina_List *filter_sources = NULL, *prev_sources = NULL;
2459 const char *src1, *src2, *part, *code; 2459 const char *src1, *src2, *part, *code;
2460 Evas_Object *obj = ep->object; 2460 Evas_Object *obj = ep->object;
@@ -2468,6 +2468,7 @@ _edje_part_recalc_single_filter(Edje *ed,
2468 filter = &chosen_edt->filter; 2468 filter = &chosen_edt->filter;
2469 prev_sources = edt->filter.sources; 2469 prev_sources = edt->filter.sources;
2470 filter_sources = chosen_edt->filter.sources; 2470 filter_sources = chosen_edt->filter.sources;
2471 prevfilter = &(edt->filter);
2471 } 2472 }
2472 else if (ep->part->type == EDJE_PART_TYPE_IMAGE) 2473 else if (ep->part->type == EDJE_PART_TYPE_IMAGE)
2473 { 2474 {
@@ -2476,6 +2477,7 @@ _edje_part_recalc_single_filter(Edje *ed,
2476 filter = &chosen_edi->filter; 2477 filter = &chosen_edi->filter;
2477 prev_sources = edi->filter.sources; 2478 prev_sources = edi->filter.sources;
2478 filter_sources = chosen_edi->filter.sources; 2479 filter_sources = chosen_edi->filter.sources;
2480 prevfilter = &(edi->filter);
2479 } 2481 }
2480 else if (ep->part->type == EDJE_PART_TYPE_PROXY) 2482 else if (ep->part->type == EDJE_PART_TYPE_PROXY)
2481 { 2483 {
@@ -2484,6 +2486,7 @@ _edje_part_recalc_single_filter(Edje *ed,
2484 filter = &chosen_edp->filter; 2486 filter = &chosen_edp->filter;
2485 prev_sources = edp->filter.sources; 2487 prev_sources = edp->filter.sources;
2486 filter_sources = chosen_edp->filter.sources; 2488 filter_sources = chosen_edp->filter.sources;
2489 prevfilter = &(edp->filter);
2487 } 2490 }
2488 else if (ep->part->type == EDJE_PART_TYPE_SNAPSHOT) 2491 else if (ep->part->type == EDJE_PART_TYPE_SNAPSHOT)
2489 { 2492 {
@@ -2492,6 +2495,7 @@ _edje_part_recalc_single_filter(Edje *ed,
2492 filter = &chosen_eds->filter; 2495 filter = &chosen_eds->filter;
2493 prev_sources = eds->filter.sources; 2496 prev_sources = eds->filter.sources;
2494 filter_sources = chosen_eds->filter.sources; 2497 filter_sources = chosen_eds->filter.sources;
2498 prevfilter = &(eds->filter);
2495 } 2499 }
2496 else 2500 else
2497 { 2501 {
@@ -2499,6 +2503,8 @@ _edje_part_recalc_single_filter(Edje *ed,
2499 return; 2503 return;
2500 } 2504 }
2501 2505
2506 if ((!filter->code) && (!prevfilter->code)) return;
2507
2502 /* common code below */ 2508 /* common code below */
2503 code = _edje_filter_get(ed, filter); 2509 code = _edje_filter_get(ed, filter);
2504 if (!code) 2510 if (!code)
@@ -4700,25 +4706,30 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta
4700 } 4706 }
4701 else 4707 else
4702 { 4708 {
4703 if (ep->nested_smart) /* Cancel map of smart obj holding nested parts */ 4709 if ((ep->param1.p.mapped) ||
4710 ((ep->param2) && (ep->param2->p.mapped)) ||
4711 ((ep->custom) && (ep->custom->p.mapped)))
4704 { 4712 {
4705 eo_do(ep->nested_smart, 4713 if (ep->nested_smart) /* Cancel map of smart obj holding nested parts */
4706 evas_obj_map_enable_set(EINA_FALSE), 4714 {
4707 evas_obj_map_set(NULL)); 4715 eo_do(ep->nested_smart,
4708 } 4716 evas_obj_map_enable_set(EINA_FALSE),
4709 else 4717 evas_obj_map_set(NULL));
4710 { 4718 }
4711#ifdef HAVE_EPHYSICS 4719 else
4712 if (!ep->body)
4713 { 4720 {
4721#ifdef HAVE_EPHYSICS
4722 if (!ep->body)
4723 {
4714#endif 4724#endif
4715 if (mo) 4725 if (mo)
4716 eo_do(mo, 4726 eo_do(mo,
4717 evas_obj_map_enable_set(0), 4727 evas_obj_map_enable_set(0),
4718 evas_obj_map_set(NULL)); 4728 evas_obj_map_set(NULL));
4719#ifdef HAVE_EPHYSICS 4729#ifdef HAVE_EPHYSICS
4720 } 4730 }
4721#endif 4731#endif
4732 }
4722 } 4733 }
4723 } 4734 }
4724 } 4735 }