diff options
author | Marcel Hollerbach <mail@marcel-hollerbach.de> | 2019-08-19 10:23:40 +0200 |
---|---|---|
committer | Marcel Hollerbach <mail@marcel-hollerbach.de> | 2019-08-20 07:42:43 +0200 |
commit | ead8a280570baded69686487a6dd27a8843fc95f (patch) | |
tree | 45fcd6f0413e4b6caf3449e0916a0b8c5677f012 /src | |
parent | cbf7d71eebb3be9dfdf7afe881456d0d5ca80f66 (diff) | |
download | efl-ead8a280570baded69686487a6dd27a8843fc95f.tar.gz |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/elementary/efl_ui_widget.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/lib/elementary/efl_ui_widget.c b/src/lib/elementary/efl_ui_widget.c index 0bd18da183..37331e4bfd 100644 --- a/src/lib/elementary/efl_ui_widget.c +++ b/src/lib/elementary/efl_ui_widget.c @@ -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); } |