efl_ui_widget: remove x,y,w,h

this is used for storing the position and size of the widget. However,
just in elm_test this eats 2KB of ram, just for saving them. The cases
where they have been used do not seem like a great performance hotspot,
additionally, in the panel cases the privat data of the widget is
achived anyways, so eo is involved and we are spending some time there
anyways.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9646
This commit is contained in:
Marcel Hollerbach 2019-08-20 11:02:39 +02:00 committed by Cedric BAIL
parent 56752e0b3b
commit 3c098673ab
5 changed files with 15 additions and 25 deletions

View File

@ -191,10 +191,11 @@ _sizing_eval(Evas_Object *obj, Efl_Ui_Layout_Data *sd, Elm_Layout_Data *ld)
if (ld)
{
Eina_Size2D size = efl_gfx_entity_size_get(sd->obj);
if (ld->restricted_calc_w)
rest_w = MIN(wd->w, rest_w);
rest_w = MIN(size.w, rest_w);
if (ld->restricted_calc_h)
rest_h = MIN(wd->h, rest_h);
rest_h = MIN(size.h, rest_h);
}
edje_object_size_min_restricted_calc(wd->resize_obj, &minw, &minh,

View File

@ -55,14 +55,13 @@ _mirrored_set(Evas_Object *obj,
EOLIAN static void
_efl_ui_panel_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Panel_Data *sd)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
if (sd->delete_me) return;
if (sd->delete_me) return;
if (sd->scrollable)
{
if (sd->hidden) _drawer_close(obj, wd->w, wd->h, EINA_FALSE);
else _drawer_open(obj, wd->w, wd->h, EINA_FALSE);
Eina_Size2D size = efl_gfx_entity_size_get(obj);
if (sd->hidden) _drawer_close(obj, size.w, size.h, EINA_FALSE);
else _drawer_open(obj, size.w, size.h, EINA_FALSE);
}
efl_canvas_group_calculate(efl_super(obj, MY_CLASS));

View File

@ -793,17 +793,19 @@ _efl_ui_widget_efl_canvas_group_group_del(Eo *obj, Elm_Widget_Smart_Data *sd)
static void
_smart_reconfigure(Elm_Widget_Smart_Data *sd)
{
Eina_Rect geom = efl_gfx_entity_geometry_get(sd->obj);
if (sd->resize_obj)
{
evas_object_geometry_set(sd->resize_obj, sd->x, sd->y, sd->w, sd->h);
efl_gfx_entity_geometry_set(sd->resize_obj, geom);
}
if (sd->hover_obj)
{
evas_object_geometry_set(sd->hover_obj, sd->x, sd->y, sd->w, sd->h);
efl_gfx_entity_geometry_set(sd->hover_obj, geom);
}
if (sd->bg)
{
evas_object_geometry_set(sd->bg, sd->x, sd->y, sd->w, sd->h);
efl_gfx_entity_geometry_set(sd->bg, geom);
}
if (sd->has_shadow)
_elm_widget_shadow_update(sd->obj);
@ -815,11 +817,6 @@ _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;
if (sd->resize_obj)
efl_gfx_entity_position_set(sd->resize_obj, pos);
if (sd->hover_obj)
@ -839,11 +836,6 @@ _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;
if (sd->resize_obj)
efl_gfx_entity_size_set(sd->resize_obj, sz);
if (sd->hover_obj)

View File

@ -58,14 +58,13 @@ _mirrored_set(Evas_Object *obj,
EOLIAN static void
_elm_panel_efl_canvas_group_calculate(Eo *obj, Elm_Panel_Data *sd)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
if (sd->delete_me) return;
if (sd->scrollable)
{
if (sd->hidden) _drawer_close(obj, wd->w, wd->h, EINA_FALSE);
else _drawer_open(obj, wd->w, wd->h, EINA_FALSE);
Eina_Size2D size = efl_gfx_entity_size_get(obj);
if (sd->hidden) _drawer_close(obj, size.w, size.h, EINA_FALSE);
else _drawer_open(obj, size.w, size.h, EINA_FALSE);
}
efl_canvas_group_calculate(efl_super(obj, MY_CLASS));

View File

@ -323,7 +323,6 @@ typedef struct _Elm_Widget_Smart_Data
{
Evas_Object *obj; /**< object pointer for this widget smart data */
Evas_Object *parent_obj; /**< parent object of a widget in the elementary tree */
Evas_Coord x, y, w, h;
Eina_List *subobjs; /**< list of widgets' sub objects in the elementary tree */
Evas_Object *resize_obj; /**< an unique object for each widget that shows the look of a widget. Resize object's geometry is same as the widget. This resize object is different from that of window's resize object. */
Evas_Object *hover_obj;