edje: improve loading time of Edje_Object with Evas_Object_Textblock and multiple styles.

This bring you a 10% speedup to the first frame of Elementary_Test.
This commit is contained in:
Cedric Bail 2013-08-01 10:51:52 +09:00
parent 6c1833246c
commit 072f73a453
4 changed files with 18 additions and 8 deletions

View File

@ -1,3 +1,7 @@
2013-08-01 Cedric Bail
* Edje: faster load time for Edje_Object using Evas_Object_Textblocks and many styles.
2013-07-31 Carsten Haitzler (The Rasterman)
* Fix efl to use key not keyname (so xmodmap works).

1
NEWS
View File

@ -124,6 +124,7 @@ Additions:
- support edc proxy.source_visible, proxy.source_clip
- support edc map color set
- Add threshold support to Edje draggable part.
- Reduce load time of Edje_Object using Evas_Object_Textblock and many styles.
* Eeze:
- Add a dummy libmount replacement for when libmount is not there.
* Ecore_Con:

View File

@ -462,6 +462,7 @@ struct _Edje_File
Edje_External_Directory *external_dir;
Edje_Image_Directory *image_dir;
Edje_Sound_Directory *sound_dir;
Eina_List *styles;
Eina_List *color_classes;
@ -501,6 +502,8 @@ struct _Edje_Style
char *name;
Eina_List *tags;
Evas_Textblock_Style *style;
Eina_Bool cache;
};
struct _Edje_Style_Tag

View File

@ -173,6 +173,9 @@ _edje_textblock_style_all_update(Edje *ed)
/* Make sure the style is already defined */
if (!stl->style) break;
/* No need to compute it again and again and again */
if (stl->cache) continue;
/* Make sure the style contains a text_class */
EINA_LIST_FOREACH(stl->tags, ll, tag)
{
@ -257,6 +260,7 @@ _edje_textblock_style_all_update(Edje *ed)
if (fontsource) free(fontsource);
/* Configure the style */
stl->cache = EINA_TRUE;
evas_textblock_style_set(stl->style, eina_strbuf_string_get(txt));
eina_strbuf_reset(txt);
}
@ -401,18 +405,16 @@ _edje_textblock_style_parse_and_fix(Edje_File *edf)
void
_edje_textblock_style_cleanup(Edje_File *edf)
{
while (edf->styles)
{
Edje_Style *stl;
Edje_Style *stl;
stl = edf->styles->data;
edf->styles = eina_list_remove_list(edf->styles, edf->styles);
while (stl->tags)
EINA_LIST_FREE(edf->styles, stl)
{
Edje_Style_Tag *tag;
EINA_LIST_FREE(stl->tags, tag)
{
Edje_Style_Tag *tag;
tag = stl->tags->data;
stl->tags = eina_list_remove_list(stl->tags, stl->tags);
if (tag->value && eet_dictionary_string_check(eet_dictionary_get(edf->ef), tag->value) == 0)
eina_stringshare_del(tag->value);
if (edf->free_strings)