evas: let's reuse what we know when possible to avoid more useless eo_data_scope_get.

This commit is contained in:
Cedric BAIL 2016-05-06 17:01:10 -07:00
parent 10c9ef771f
commit ddf92ba61b
6 changed files with 16 additions and 18 deletions

View File

@ -372,7 +372,7 @@ _evas_object_clip_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Object *
EINA_COW_STATE_WRITE_END(clip, state_write, cur);
if (clip->changed)
evas_object_update_bounding_box(eo_clip, clip);
evas_object_update_bounding_box(eo_clip, clip, NULL);
}
evas_object_change(eo_clip, clip);

View File

@ -528,7 +528,7 @@ _evas_object_map_enable_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Eina_Bo
else
{
if (_evas_object_map_parent_check(obj->smart.parent))
evas_object_update_bounding_box(eo_obj, obj);
evas_object_update_bounding_box(eo_obj, obj, NULL);
}
}

View File

@ -904,7 +904,7 @@ _evas_object_efl_gfx_base_position_set(Eo *eo_obj, Evas_Object_Protected_Data *o
}
EINA_COW_STATE_WRITE_END(obj, state_write, cur);
evas_object_update_bounding_box(eo_obj, obj);
evas_object_update_bounding_box(eo_obj, obj, NULL);
//// obj->cur->cache.geometry.validity = 0;
obj->changed_move = EINA_TRUE;
@ -986,7 +986,7 @@ _evas_object_efl_gfx_base_size_set(Eo *eo_obj, Evas_Object_Protected_Data *obj,
}
EINA_COW_STATE_WRITE_END(obj, state_write, cur);
evas_object_update_bounding_box(eo_obj, obj);
evas_object_update_bounding_box(eo_obj, obj, NULL);
//// obj->cur->cache.geometry.validity = 0;
evas_object_change(eo_obj, obj);

View File

@ -213,7 +213,7 @@ _evas_object_smart_member_add(Eo *smart_obj, Evas_Smart_Data *o, Evas_Object *eo
Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
Evas_Object_Protected_Data *smart = eo_data_scope_get(smart_obj, EVAS_OBJECT_CLASS);
Evas_Smart_Data *member_o;
Evas_Smart_Data *member_o = NULL;
if (obj->delete_me)
{
@ -281,7 +281,7 @@ _evas_object_smart_member_add(Eo *smart_obj, Evas_Smart_Data *o, Evas_Object *eo
evas_object_mapped_clip_across_mark(eo_obj, obj);
if (smart->smart.smart && smart->smart.smart->smart_class->member_add)
smart->smart.smart->smart_class->member_add(smart_obj, eo_obj);
evas_object_update_bounding_box(eo_obj, obj);
evas_object_update_bounding_box(eo_obj, obj, member_o);
}
EAPI void
@ -1090,9 +1090,8 @@ evas_object_smart_del(Evas_Object *eo_obj)
}
void
evas_object_update_bounding_box(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
evas_object_update_bounding_box(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Smart_Data *s)
{
Evas_Smart_Data *s = NULL;
Eina_Bool propagate = EINA_FALSE;
Eina_Bool computeminmax = EINA_FALSE;
Evas_Coord x, y, w, h;
@ -1108,7 +1107,7 @@ evas_object_update_bounding_box(Evas_Object *eo_obj, Evas_Object_Protected_Data
if (obj->is_smart)
{
s = eo_data_scope_get(eo_obj, MY_CLASS);
s = s == NULL ? eo_data_scope_get(eo_obj, MY_CLASS) : s;
x = s->cur.bounding_box.x;
y = s->cur.bounding_box.y;
@ -1134,8 +1133,8 @@ evas_object_update_bounding_box(Evas_Object *eo_obj, Evas_Object_Protected_Data
/* We are not yet trying to find the smallest bounding box, but we want to find a good approximation quickly.
* That's why we initialiaze min and max search to geometry of the parent object.
*/
Evas_Object_Protected_Data *smart_obj = eo_data_scope_get(obj->smart.parent, EVAS_OBJECT_CLASS);
Evas_Smart_Data *smart_parent = eo_data_scope_get(obj->smart.parent, MY_CLASS);
Evas_Object_Protected_Data *smart_obj = obj->smart.parent_object_data;
Evas_Smart_Data *smart_parent = obj->smart.parent_data;
if (!smart_parent || !smart_obj) return;
if (smart_obj->cur->valid_bounding_box)
@ -1223,7 +1222,7 @@ evas_object_update_bounding_box(Evas_Object *eo_obj, Evas_Object_Protected_Data
}
if (propagate)
evas_object_update_bounding_box(obj->smart.parent, smart_obj);
evas_object_update_bounding_box(obj->smart.parent, smart_obj, smart_parent);
}
void

View File

@ -578,7 +578,7 @@ _evas_render_phase1_object_process(Evas_Public_Data *e, Evas_Object *eo_obj,
evas_object_change(obj->cur->clipper->object, obj->cur->clipper);
evas_object_clip_dirty(obj->cur->clipper->object, obj->cur->clipper);
evas_object_clip_recalc(obj->cur->clipper);
evas_object_update_bounding_box(eo_obj, obj);
evas_object_update_bounding_box(eo_obj, obj, NULL);
}
if (obj->changed)
{
@ -638,7 +638,7 @@ _evas_render_phase1_object_process(Evas_Public_Data *e, Evas_Object *eo_obj,
evas_object_change(obj->cur->clipper->object, obj->cur->clipper);
evas_object_clip_dirty(obj->cur->clipper->object, obj->cur->clipper);
evas_object_clip_recalc(obj->cur->clipper);
evas_object_update_bounding_box(eo_obj, obj);
evas_object_update_bounding_box(eo_obj, obj, NULL);
}
}

View File

@ -1518,7 +1518,7 @@ Evas_Object *evas_object_new(Evas *e);
void evas_object_change_reset(Evas_Object *obj);
void evas_object_cur_prev(Evas_Object *obj);
void evas_object_free(Evas_Object *obj, int clean_layer);
void evas_object_update_bounding_box(Evas_Object *obj, Evas_Object_Protected_Data *pd);
void evas_object_update_bounding_box(Evas_Object *obj, Evas_Object_Protected_Data *pd, Evas_Smart_Data *s);
void evas_object_inject(Evas_Object *obj, Evas_Object_Protected_Data *pd, Evas *e);
void evas_object_release(Evas_Object *obj, Evas_Object_Protected_Data *pd, int clean_layer);
void evas_object_change(Evas_Object *obj, Evas_Object_Protected_Data *pd);
@ -1575,9 +1575,8 @@ void _evas_object_image_video_overlay_hide(Evas_Object *obj);
void _evas_object_image_video_overlay_do(Evas_Object *obj);
void _evas_object_image_free(Evas_Object *obj);
void evas_object_smart_bounding_box_get(Evas_Object *eo_obj,
Evas_Coord_Rectangle *cur_bounding_box,
Evas_Coord_Rectangle *prev_bounding_box);
void evas_object_update_bounding_box(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj);
Evas_Coord_Rectangle *cur_bounding_box,
Evas_Coord_Rectangle *prev_bounding_box);
void evas_object_smart_del(Evas_Object *obj);
void evas_object_smart_cleanup(Evas_Object *obj);
void evas_object_smart_member_raise(Evas_Object *member);