summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--NEWS1
-rw-r--r--src/lib/edje/edje_private.h3
-rw-r--r--src/lib/edje/edje_textblock_styles.c16
4 files changed, 17 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 40ff74b51c..0c2c627900 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
12013-08-01 Cedric Bail
2
3 * Edje: faster load time for Edje_Object using Evas_Object_Textblocks and many styles.
4
12013-07-31 Carsten Haitzler (The Rasterman) 52013-07-31 Carsten Haitzler (The Rasterman)
2 6
3 * Fix efl to use key not keyname (so xmodmap works). 7 * Fix efl to use key not keyname (so xmodmap works).
diff --git a/NEWS b/NEWS
index 776442fe27..a1dfab0db2 100644
--- a/NEWS
+++ b/NEWS
@@ -124,6 +124,7 @@ Additions:
124 - support edc proxy.source_visible, proxy.source_clip 124 - support edc proxy.source_visible, proxy.source_clip
125 - support edc map color set 125 - support edc map color set
126 - Add threshold support to Edje draggable part. 126 - Add threshold support to Edje draggable part.
127 - Reduce load time of Edje_Object using Evas_Object_Textblock and many styles.
127 * Eeze: 128 * Eeze:
128 - Add a dummy libmount replacement for when libmount is not there. 129 - Add a dummy libmount replacement for when libmount is not there.
129 * Ecore_Con: 130 * Ecore_Con:
diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h
index 20124b4656..8f587e2fd2 100644
--- a/src/lib/edje/edje_private.h
+++ b/src/lib/edje/edje_private.h
@@ -462,6 +462,7 @@ struct _Edje_File
462 Edje_External_Directory *external_dir; 462 Edje_External_Directory *external_dir;
463 Edje_Image_Directory *image_dir; 463 Edje_Image_Directory *image_dir;
464 Edje_Sound_Directory *sound_dir; 464 Edje_Sound_Directory *sound_dir;
465
465 Eina_List *styles; 466 Eina_List *styles;
466 467
467 Eina_List *color_classes; 468 Eina_List *color_classes;
@@ -501,6 +502,8 @@ struct _Edje_Style
501 char *name; 502 char *name;
502 Eina_List *tags; 503 Eina_List *tags;
503 Evas_Textblock_Style *style; 504 Evas_Textblock_Style *style;
505
506 Eina_Bool cache;
504}; 507};
505 508
506struct _Edje_Style_Tag 509struct _Edje_Style_Tag
diff --git a/src/lib/edje/edje_textblock_styles.c b/src/lib/edje/edje_textblock_styles.c
index 32fa67791f..8b2b21f0f5 100644
--- a/src/lib/edje/edje_textblock_styles.c
+++ b/src/lib/edje/edje_textblock_styles.c
@@ -173,6 +173,9 @@ _edje_textblock_style_all_update(Edje *ed)
173 /* Make sure the style is already defined */ 173 /* Make sure the style is already defined */
174 if (!stl->style) break; 174 if (!stl->style) break;
175 175
176 /* No need to compute it again and again and again */
177 if (stl->cache) continue;
178
176 /* Make sure the style contains a text_class */ 179 /* Make sure the style contains a text_class */
177 EINA_LIST_FOREACH(stl->tags, ll, tag) 180 EINA_LIST_FOREACH(stl->tags, ll, tag)
178 { 181 {
@@ -257,6 +260,7 @@ _edje_textblock_style_all_update(Edje *ed)
257 if (fontsource) free(fontsource); 260 if (fontsource) free(fontsource);
258 261
259 /* Configure the style */ 262 /* Configure the style */
263 stl->cache = EINA_TRUE;
260 evas_textblock_style_set(stl->style, eina_strbuf_string_get(txt)); 264 evas_textblock_style_set(stl->style, eina_strbuf_string_get(txt));
261 eina_strbuf_reset(txt); 265 eina_strbuf_reset(txt);
262 } 266 }
@@ -401,18 +405,16 @@ _edje_textblock_style_parse_and_fix(Edje_File *edf)
401void 405void
402_edje_textblock_style_cleanup(Edje_File *edf) 406_edje_textblock_style_cleanup(Edje_File *edf)
403{ 407{
404 while (edf->styles) 408 Edje_Style *stl;
409
410 EINA_LIST_FREE(edf->styles, stl)
405 { 411 {
406 Edje_Style *stl; 412 Edje_Style_Tag *tag;
407 413
408 stl = edf->styles->data; 414 EINA_LIST_FREE(stl->tags, tag)
409 edf->styles = eina_list_remove_list(edf->styles, edf->styles);
410 while (stl->tags)
411 { 415 {
412 Edje_Style_Tag *tag; 416 Edje_Style_Tag *tag;
413 417
414 tag = stl->tags->data;
415 stl->tags = eina_list_remove_list(stl->tags, stl->tags);
416 if (tag->value && eet_dictionary_string_check(eet_dictionary_get(edf->ef), tag->value) == 0) 418 if (tag->value && eet_dictionary_string_check(eet_dictionary_get(edf->ef), tag->value) == 0)
417 eina_stringshare_del(tag->value); 419 eina_stringshare_del(tag->value);
418 if (edf->free_strings) 420 if (edf->free_strings)