summaryrefslogtreecommitdiff
path: root/src/lib/edje/edje_calc.c
diff options
context:
space:
mode:
authorWoochanlee <wc0917.lee@samsung.com>2019-11-14 05:16:18 +0000
committerCedric BAIL <cedric.bail@free.fr>2019-11-14 10:08:56 -0800
commit37b55172b0d46d71f772af8fba17e1fb1b7c6c2c (patch)
treeed54cc61ec3df037ed11d649b629d635e5845b85 /src/lib/edje/edje_calc.c
parent2288c92bc5422c1a5df5fa4f6aabc2307a297e9d (diff)
edje_calc: Exception handling if no calculation is required.
If there is no object swllowed, do not run part_calc on it. This swallow will be calculated if there is an associated part, otherwise it will not need to be calculated. When the app is launched, a lot of edje calculation logic is executed. Most of the edje size is missing, so the calculation result is meaningless. Added code to prevent this. Reviewed-by: Cedric BAIL <cedric.bail@free.fr> Differential Revision: https://phab.enlightenment.org/D10605
Diffstat (limited to '')
-rw-r--r--src/lib/edje/edje_calc.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c
index 59349b40b4..736ccb4b53 100644
--- a/src/lib/edje/edje_calc.c
+++ b/src/lib/edje/edje_calc.c
@@ -988,6 +988,13 @@ _edje_recalc_table_parts(Edje *ed
988 for (i = 0; i < ed->table_parts_size; i++) 988 for (i = 0; i < ed->table_parts_size; i++)
989 { 989 {
990 ep = ed->table_parts[i]; 990 ep = ed->table_parts[i];
991
992 //Ignore if the real part doesn't have swallowed object
993 if ((ep->part->type == EDJE_PART_TYPE_SWALLOW) &&
994 (ep->typedata.swallow) &&
995 (!ep->typedata.swallow->swallowed_object))
996 continue;
997
991 if (ep->calculated != FLAG_XY) // FIXME: this is always true (see for above) 998 if (ep->calculated != FLAG_XY) // FIXME: this is always true (see for above)
992 _edje_part_recalc(ed, ep, (~ep->calculated) & FLAG_XY, NULL); 999 _edje_part_recalc(ed, ep, (~ep->calculated) & FLAG_XY, NULL);
993 } 1000 }
@@ -997,6 +1004,25 @@ _edje_recalc_table_parts(Edje *ed
997} 1004}
998 1005
999void 1006void
1007_edje_recalc_textblock_style_text_set(Edje *ed)
1008{
1009 unsigned short i;
1010 Edje_Real_Part *ep;
1011 Edje_Part_Description_Text *chosen_desc;
1012
1013 for (i = 0; i < ed->table_parts_size; i++)
1014 {
1015 ep = ed->table_parts[i];
1016
1017 if (ep->part->type == EDJE_PART_TYPE_TEXTBLOCK)
1018 {
1019 _edje_part_textblock_style_text_set
1020 (ed, ep, (Edje_Part_Description_Text *)ep->chosen_description);
1021 }
1022 }
1023}
1024
1025void
1000_edje_recalc_do(Edje *ed) 1026_edje_recalc_do(Edje *ed)
1001{ 1027{
1002 unsigned short i; 1028 unsigned short i;
@@ -1005,6 +1031,17 @@ _edje_recalc_do(Edje *ed)
1005 Eina_Bool need_reinit_state = EINA_FALSE; 1031 Eina_Bool need_reinit_state = EINA_FALSE;
1006#endif 1032#endif
1007 1033
1034
1035 //Do nothing if the edje has no size, Regardless of the edje part size calc,
1036 //the text and style has to be set.
1037 if ((EINA_UNLIKELY(!ed->has_size)) && (!ed->calc_only) && (ed->w == 0) && (ed->h == 0))
1038 {
1039 _edje_recalc_textblock_style_text_set(ed);
1040
1041 return;
1042 }
1043 ed->has_size = EINA_TRUE;
1044
1008 need_calc = evas_object_smart_need_recalculate_get(ed->obj); 1045 need_calc = evas_object_smart_need_recalculate_get(ed->obj);
1009 evas_object_smart_need_recalculate_set(ed->obj, 0); 1046 evas_object_smart_need_recalculate_set(ed->obj, 0);
1010 if (!ed->dirty) return; 1047 if (!ed->dirty) return;