From ead8a280570baded69686487a6dd27a8843fc95f Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Mon, 19 Aug 2019 10:23:40 +0200 Subject: [PATCH] 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 Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D9619 --- src/lib/elementary/efl_ui_widget.c | 26 ++++++++++++++++++++++++-- 1 file 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); }