summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHosang Kim <hosang12.kim@samsung.com>2016-03-17 11:12:34 -0700
committerCedric BAIL <cedric@osg.samsung.com>2016-03-17 11:53:26 -0700
commit264ccb13ede2b90bf4f760a88c0eafc8b3ff954a (patch)
tree016de18812bcb81b12f0a1f608b2f674c10015c2 /src
parent08d72bf85fc11f9f92364e69a8d04391c17ba292 (diff)
edje: add fixed automatically for optimizing edje calc speed.
Summary: Applications usually use edje syntax like as, ``` part { name :"bg"; type: SWALLOW; description { state: "default" 0.0; rel1.relative: 0.0 0.0; rel2.relative: 0.0 0.0; align: 0.0 0.0; min: 100 100; } } ``` But edje does not calculate it exactly without "fixed: 1 1". So edje calculation is repeated until 4000 x 4000, it is waste of time. Reviewers: woohyun, raster, Hermet, id213sin, cedric Reviewed By: cedric Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D3801 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src')
-rw-r--r--src/lib/edje/edje_calc.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c
index d8c607ff66..57de6a4c52 100644
--- a/src/lib/edje/edje_calc.c
+++ b/src/lib/edje/edje_calc.c
@@ -2725,6 +2725,7 @@ _edje_part_recalc_single(Edje *ed,
2725 Edje_Color_Class *cc = NULL; 2725 Edje_Color_Class *cc = NULL;
2726 Edje_Internal_Aspect apref; 2726 Edje_Internal_Aspect apref;
2727 int minw = 0, minh = 0, maxw = 0, maxh = 0; 2727 int minw = 0, minh = 0, maxw = 0, maxh = 0;
2728 Eina_Bool fixedw = EINA_FALSE, fixedh = EINA_FALSE;
2728 FLOAT_T sc; 2729 FLOAT_T sc;
2729 2730
2730 sc = DIV(ed->scale, ed->file->base_scale); 2731 sc = DIV(ed->scale, ed->file->base_scale);
@@ -2742,6 +2743,26 @@ _edje_part_recalc_single(Edje *ed,
2742 /* size step */ 2743 /* size step */
2743 _edje_part_recalc_single_step(desc, params); 2744 _edje_part_recalc_single_step(desc, params);
2744 2745
2746 /* check whether this part has fixed value or not*/
2747 if ((rel1_to_x == rel2_to_x) &&
2748 (desc->rel1.relative_x == desc->rel2.relative_x) &&
2749 (!chosen_desc->fixed.w))
2750 {
2751 chosen_desc->fixed.w = 1;
2752 fixedw = EINA_TRUE;
2753 }
2754
2755 if ((rel1_to_y == rel2_to_y) &&
2756 (desc->rel1.relative_y == desc->rel2.relative_y) &&
2757 (!chosen_desc->fixed.h))
2758 {
2759 chosen_desc->fixed.h = 1;
2760 fixedh = EINA_TRUE;
2761 }
2762 if (fixedw || fixedh)
2763 ERR("file %s, group %s has a non-fixed part '%s'. You should add 'fixed: %d %d'. But in order to optimize the edje calc, we add it automatically.",ed->path, ed->group, ep->part->name, fixedw, fixedh);
2764
2765
2745 /* colors */ 2766 /* colors */
2746 if (ep->part->type != EDJE_PART_TYPE_SPACER) 2767 if (ep->part->type != EDJE_PART_TYPE_SPACER)
2747 { 2768 {