elm_win: freeze frame object edje until first pre-render

this avoids a substantial number of unnecessary recalcs and halves the calltime
for elm_win_add

ref T6884

Differential Revision: https://phab.enlightenment.org/D5944
This commit is contained in:
Mike Blumenkrantz 2018-04-16 13:17:42 -04:00
parent a1f649fa9d
commit 34be51e105
1 changed files with 7 additions and 10 deletions

View File

@ -993,6 +993,8 @@ _elm_win_pre_render(Ecore_Evas *ee)
if (!sd->first_draw)
{
sd->first_draw = EINA_TRUE;
edje_object_thaw(sd->frame_obj);
_elm_win_frame_style_update(sd, 1, 1);
_elm_win_frame_obj_update(sd);
ELM_WIN_DATA_ALIVE_CHECK(obj, sd);
}
@ -4251,7 +4253,7 @@ static void
_elm_win_frame_add(Efl_Ui_Win_Data *sd, const char *element, const char *style)
{
Evas_Object *obj = sd->obj;
int w, h, mw, mh, v;
int w, h, v;
const char *version;
if (sd->frame_obj) return;
@ -4297,6 +4299,7 @@ _elm_win_frame_add(Efl_Ui_Win_Data *sd, const char *element, const char *style)
free(sys_theme);
}
edje_object_freeze(sd->frame_obj);
/* Small hack: The special value 2 means this is the top frame object.
* We propagate to the children now (the edc group contents), but subsequent
* calls to smart_member_add will not propagate the flag further. Note that
@ -4337,15 +4340,6 @@ _elm_win_frame_add(Efl_Ui_Win_Data *sd, const char *element, const char *style)
evas_object_event_callback_add
(sd->frame_obj, EVAS_CALLBACK_RESIZE, _elm_win_frame_obj_resize, sd);
_elm_win_frame_style_update(sd, 1, 0);
/* NB: Do NOT remove these calls !! Needed to calculate proper
* framespace on initial show of the window */
edje_object_size_min_calc(sd->frame_obj, &mw, &mh);
evas_object_move(sd->frame_obj, 0, 0);
evas_object_resize(sd->frame_obj, mw, mh);
evas_object_smart_calculate(sd->frame_obj);
edje_object_signal_callback_add
(sd->frame_obj, "elm,action,move,start", "elm",
_elm_win_frame_cb_move_start, obj);
@ -4393,6 +4387,9 @@ _elm_win_frame_add(Efl_Ui_Win_Data *sd, const char *element, const char *style)
efl_canvas_object_render_op_set(bgrect, EFL_GFX_RENDER_OP_COPY);
}
if (sd->first_draw)
edje_object_thaw(sd->frame_obj);
if (!efl_finalized_get(obj)) return;
_elm_win_frame_style_update(sd, 1, 1);
_elm_win_frame_geometry_adjust(sd);
ecore_evas_geometry_get(sd->ee, NULL, NULL, &w, &h);