efl_ui_widget: optimize size / position setting

calling geometry set here is again calling the API in canvas object that
splits this call to size_set and position_set which means we spent quite
a bit of time in eo, just to call the same APIs we could call directly.
With this commit here, the calls are directly going to the right
objects, with the right API.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9619
This commit is contained in:
Marcel Hollerbach 2019-08-19 10:23:40 +02:00
parent cbf7d71eeb
commit ead8a28057
1 changed files with 24 additions and 2 deletions

View File

@ -804,9 +804,20 @@ _efl_ui_widget_efl_gfx_entity_position_set(Eo *obj EINA_UNUSED, Elm_Widget_Smart
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y))
return;
if (sd->x == pos.x && sd->y == pos.y)
return;
sd->x = pos.x;
sd->y = pos.y;
_smart_reconfigure(sd);
if (sd->resize_obj)
efl_gfx_entity_position_set(sd->resize_obj, pos);
if (sd->hover_obj)
efl_gfx_entity_position_set(sd->hover_obj, pos);
if (sd->bg)
efl_gfx_entity_position_set(sd->bg, pos);
if (sd->has_shadow)
_elm_widget_shadow_update(sd->obj);
efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos);
}
@ -817,9 +828,20 @@ _efl_ui_widget_efl_gfx_entity_size_set(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Dat
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, sz.w, sz.h))
return;
if (sd->w == sz.w && sd->h == sz.h)
return;
sd->w = sz.w;
sd->h = sz.h;
_smart_reconfigure(sd);
if (sd->resize_obj)
efl_gfx_entity_size_set(sd->resize_obj, sz);
if (sd->hover_obj)
efl_gfx_entity_size_set(sd->hover_obj, sz);
if (sd->bg)
efl_gfx_entity_size_set(sd->bg, sz);
if (sd->has_shadow)
_elm_widget_shadow_update(sd->obj);
efl_gfx_entity_size_set(efl_super(obj, MY_CLASS), sz);
}