summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-08-19 10:23:40 +0200
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-08-20 07:42:43 +0200
commitead8a280570baded69686487a6dd27a8843fc95f (patch)
tree45fcd6f0413e4b6caf3449e0916a0b8c5677f012
parentcbf7d71eebb3be9dfdf7afe881456d0d5ca80f66 (diff)
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
-rw-r--r--src/lib/elementary/efl_ui_widget.c26
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
804 if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y)) 804 if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y))
805 return; 805 return;
806 806
807 if (sd->x == pos.x && sd->y == pos.y)
808 return;
809
807 sd->x = pos.x; 810 sd->x = pos.x;
808 sd->y = pos.y; 811 sd->y = pos.y;
809 _smart_reconfigure(sd); 812 if (sd->resize_obj)
813 efl_gfx_entity_position_set(sd->resize_obj, pos);
814 if (sd->hover_obj)
815 efl_gfx_entity_position_set(sd->hover_obj, pos);
816 if (sd->bg)
817 efl_gfx_entity_position_set(sd->bg, pos);
818
819 if (sd->has_shadow)
820 _elm_widget_shadow_update(sd->obj);
810 821
811 efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos); 822 efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos);
812} 823}
@@ -817,9 +828,20 @@ _efl_ui_widget_efl_gfx_entity_size_set(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Dat
817 if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, sz.w, sz.h)) 828 if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, sz.w, sz.h))
818 return; 829 return;
819 830
831 if (sd->w == sz.w && sd->h == sz.h)
832 return;
833
820 sd->w = sz.w; 834 sd->w = sz.w;
821 sd->h = sz.h; 835 sd->h = sz.h;
822 _smart_reconfigure(sd); 836 if (sd->resize_obj)
837 efl_gfx_entity_size_set(sd->resize_obj, sz);
838 if (sd->hover_obj)
839 efl_gfx_entity_size_set(sd->hover_obj, sz);
840 if (sd->bg)
841 efl_gfx_entity_size_set(sd->bg, sz);
842
843 if (sd->has_shadow)
844 _elm_widget_shadow_update(sd->obj);
823 845
824 efl_gfx_entity_size_set(efl_super(obj, MY_CLASS), sz); 846 efl_gfx_entity_size_set(efl_super(obj, MY_CLASS), sz);
825} 847}