add use of freeze+thaw for improvement in out-there scenarios.

SVN revision: 59730
This commit is contained in:
Carsten Haitzler 2011-05-27 10:32:53 +00:00
parent bdba0b8171
commit 66aef5074f
4 changed files with 49 additions and 6 deletions

View File

@ -103,3 +103,10 @@
the cursor really didn't change, it's more like a new cursor. the cursor really didn't change, it's more like a new cursor.
Also, when setting position, don't do anything if position is as it Also, when setting position, don't do anything if position is as it
was. was.
2011-05-27 Carsten Haitzler (The Rasterman)
* Improve performance on create/delete of edje objects by using
evas freeze and thaw calls. May help in certain pathological
situations.

View File

@ -491,13 +491,14 @@ _sel_update(Evas_Textblock_Cursor *c __UNUSED__, Evas_Object *o, Entry *en)
Sel *sel; Sel *sel;
Evas_Coord x, y, w, h; Evas_Coord x, y, w, h;
Evas_Object *smart, *clip; Evas_Object *smart, *clip;
Evas *tev = evas_object_evas_get(o);
smart = evas_object_smart_parent_get(o); smart = evas_object_smart_parent_get(o);
clip = evas_object_clip_get(o); clip = evas_object_clip_get(o);
if (en->sel_start) if (en->sel_start)
range = evas_textblock_cursor_range_geometry_get(en->sel_start, en->sel_end); range = evas_textblock_cursor_range_geometry_get(en->sel_start, en->sel_end);
else else return;
return; evas_event_freeze(tev);
if (eina_list_count(range) != eina_list_count(en->sel)) if (eina_list_count(range) != eina_list_count(en->sel))
{ {
while (en->sel) while (en->sel)
@ -572,6 +573,8 @@ _sel_update(Evas_Textblock_Cursor *c __UNUSED__, Evas_Object *o, Entry *en)
range = eina_list_remove_list(range, range); range = eina_list_remove_list(range, range);
} }
} }
evas_event_thaw(tev);
evas_event_thaw_eval(tev);
} }
static void static void

View File

@ -262,6 +262,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
Eina_List *parts = NULL; Eina_List *parts = NULL;
Eina_List *old_swallows; Eina_List *old_swallows;
int group_path_started = 0; int group_path_started = 0;
Evas *tev = evas_object_evas_get(obj);
ed = _edje_fetch(obj); ed = _edje_fetch(obj);
if (!ed) return 0; if (!ed) return 0;
@ -271,6 +272,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
(ed->group) && (!strcmp(group, ed->group))) (ed->group) && (!strcmp(group, ed->group)))
return 1; return 1;
evas_event_freeze(tev);
old_swallows = _edje_swallows_collect(ed); old_swallows = _edje_swallows_collect(ed);
if (_edje_script_only(ed)) _edje_script_only_shutdown(ed); if (_edje_script_only(ed)) _edje_script_only_shutdown(ed);
@ -354,6 +356,8 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
if (!rp) if (!rp)
{ {
ed->load_error = EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; ed->load_error = EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
evas_event_thaw(tev);
evas_event_thaw_eval(tev);
return 0; return 0;
} }
@ -366,7 +370,9 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
{ {
ed->load_error = EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; ed->load_error = EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
free(rp); free(rp);
return 0; evas_event_thaw(tev);
evas_event_thaw_eval(tev);
return 0;
} }
rp->drag->step.x = FROM_INT(ep->dragable.step_x); rp->drag->step.x = FROM_INT(ep->dragable.step_x);
@ -685,6 +691,8 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
eina_list_free(group_path); eina_list_free(group_path);
} }
ed->load_error = EDJE_LOAD_ERROR_RECURSIVE_REFERENCE; ed->load_error = EDJE_LOAD_ERROR_RECURSIVE_REFERENCE;
evas_event_thaw(tev);
evas_event_thaw_eval(tev);
return 0; return 0;
} }
} }
@ -707,6 +715,8 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
} }
} }
ed->load_error = edje_object_load_error_get(child_obj); ed->load_error = edje_object_load_error_get(child_obj);
evas_event_thaw(tev);
evas_event_thaw_eval(tev);
return 0; return 0;
} }
child_ed = _edje_fetch(child_obj); child_ed = _edje_fetch(child_obj);
@ -826,12 +836,20 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
} }
} }
_edje_entry_init(ed); _edje_entry_init(ed);
evas_event_thaw(tev);
evas_event_thaw_eval(tev);
return 1; return 1;
} }
else else
return 0; {
evas_event_thaw(tev);
evas_event_thaw_eval(tev);
return 0;
}
ed->load_error = EDJE_LOAD_ERROR_NONE; ed->load_error = EDJE_LOAD_ERROR_NONE;
_edje_entry_init(ed); _edje_entry_init(ed);
evas_event_thaw(tev);
evas_event_thaw_eval(tev);
return 1; return 1;
} }
@ -875,6 +893,9 @@ _edje_swallows_collect(Edje *ed)
void void
_edje_file_del(Edje *ed) _edje_file_del(Edje *ed)
{ {
Evas *tev = evas_object_evas_get(ed->obj);
evas_event_freeze(tev);
if (ed->freeze_calc) if (ed->freeze_calc)
{ {
_edje_freeze_calc_list = eina_list_remove(_edje_freeze_calc_list, ed); _edje_freeze_calc_list = eina_list_remove(_edje_freeze_calc_list, ed);
@ -891,7 +912,12 @@ _edje_file_del(Edje *ed)
// if (ed->collection->script) _edje_embryo_script_shutdown(ed); // if (ed->collection->script) _edje_embryo_script_shutdown(ed);
// } // }
if (!((ed->file) && (ed->collection))) return; if (!((ed->file) && (ed->collection)))
{
evas_event_thaw(tev);
evas_event_thaw_eval(tev);
return;
}
if (ed->table_parts) if (ed->table_parts)
{ {
unsigned int i; unsigned int i;
@ -1019,6 +1045,8 @@ _edje_file_del(Edje *ed)
ed->table_programs = NULL; ed->table_programs = NULL;
ed->table_programs_size = 0; ed->table_programs_size = 0;
ed->focused_part = NULL; ed->focused_part = NULL;
evas_event_thaw(tev);
evas_event_thaw_eval(tev);
} }
void void

View File

@ -80,7 +80,9 @@ static void
_edje_smart_add(Evas_Object *obj) _edje_smart_add(Evas_Object *obj)
{ {
Edje *ed; Edje *ed;
Evas *tev = evas_object_evas_get(obj);
evas_event_freeze(tev);
ed = evas_object_smart_data_get(obj); ed = evas_object_smart_data_get(obj);
if (!ed) if (!ed)
{ {
@ -88,7 +90,7 @@ _edje_smart_add(Evas_Object *obj)
const Evas_Smart_Class *sc; const Evas_Smart_Class *sc;
ed = calloc(1, sizeof(Edje)); ed = calloc(1, sizeof(Edje));
if (!ed) return; if (!ed) goto end_smart_add;
smart = evas_object_smart_smart_get(obj); smart = evas_object_smart_smart_get(obj);
sc = evas_smart_class_get(smart); sc = evas_smart_class_get(smart);
@ -126,6 +128,9 @@ _edje_smart_add(Evas_Object *obj)
printf("--- EDJE DUMP [%i]\n", eina_list_count(_edje_edjes)); printf("--- EDJE DUMP [%i]\n", eina_list_count(_edje_edjes));
} }
*/ */
end_smart_add:
evas_event_thaw(tev);
evas_event_thaw_eval(tev);
} }
static void static void