summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2016-05-06 17:01:10 -0700
committerCedric BAIL <cedric@osg.samsung.com>2016-05-06 17:01:10 -0700
commitddf92ba61b0d544cb72b8b3ffc72d7b1cd68b48f (patch)
tree3a9fdb1f78d9472bbc9abbc2a3f643519d053872 /src
parent10c9ef771f976ff6fc55544588e7dec576387d64 (diff)
evas: let's reuse what we know when possible to avoid more useless eo_data_scope_get.
Diffstat (limited to 'src')
-rw-r--r--src/lib/evas/canvas/evas_clip.c2
-rw-r--r--src/lib/evas/canvas/evas_map.c2
-rw-r--r--src/lib/evas/canvas/evas_object_main.c4
-rw-r--r--src/lib/evas/canvas/evas_object_smart.c15
-rw-r--r--src/lib/evas/canvas/evas_render.c4
-rw-r--r--src/lib/evas/include/evas_private.h7
6 files changed, 16 insertions, 18 deletions
diff --git a/src/lib/evas/canvas/evas_clip.c b/src/lib/evas/canvas/evas_clip.c
index 3fda1f72ea..89c102ac94 100644
--- a/src/lib/evas/canvas/evas_clip.c
+++ b/src/lib/evas/canvas/evas_clip.c
@@ -372,7 +372,7 @@ _evas_object_clip_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Object *
372 EINA_COW_STATE_WRITE_END(clip, state_write, cur); 372 EINA_COW_STATE_WRITE_END(clip, state_write, cur);
373 373
374 if (clip->changed) 374 if (clip->changed)
375 evas_object_update_bounding_box(eo_clip, clip); 375 evas_object_update_bounding_box(eo_clip, clip, NULL);
376 } 376 }
377 377
378 evas_object_change(eo_clip, clip); 378 evas_object_change(eo_clip, clip);
diff --git a/src/lib/evas/canvas/evas_map.c b/src/lib/evas/canvas/evas_map.c
index 53c18fc96f..84886441f6 100644
--- a/src/lib/evas/canvas/evas_map.c
+++ b/src/lib/evas/canvas/evas_map.c
@@ -528,7 +528,7 @@ _evas_object_map_enable_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Eina_Bo
528 else 528 else
529 { 529 {
530 if (_evas_object_map_parent_check(obj->smart.parent)) 530 if (_evas_object_map_parent_check(obj->smart.parent))
531 evas_object_update_bounding_box(eo_obj, obj); 531 evas_object_update_bounding_box(eo_obj, obj, NULL);
532 } 532 }
533} 533}
534 534
diff --git a/src/lib/evas/canvas/evas_object_main.c b/src/lib/evas/canvas/evas_object_main.c
index 1e84571516..ae8cc04e88 100644
--- a/src/lib/evas/canvas/evas_object_main.c
+++ b/src/lib/evas/canvas/evas_object_main.c
@@ -904,7 +904,7 @@ _evas_object_efl_gfx_base_position_set(Eo *eo_obj, Evas_Object_Protected_Data *o
904 } 904 }
905 EINA_COW_STATE_WRITE_END(obj, state_write, cur); 905 EINA_COW_STATE_WRITE_END(obj, state_write, cur);
906 906
907 evas_object_update_bounding_box(eo_obj, obj); 907 evas_object_update_bounding_box(eo_obj, obj, NULL);
908 908
909//// obj->cur->cache.geometry.validity = 0; 909//// obj->cur->cache.geometry.validity = 0;
910 obj->changed_move = EINA_TRUE; 910 obj->changed_move = EINA_TRUE;
@@ -986,7 +986,7 @@ _evas_object_efl_gfx_base_size_set(Eo *eo_obj, Evas_Object_Protected_Data *obj,
986 } 986 }
987 EINA_COW_STATE_WRITE_END(obj, state_write, cur); 987 EINA_COW_STATE_WRITE_END(obj, state_write, cur);
988 988
989 evas_object_update_bounding_box(eo_obj, obj); 989 evas_object_update_bounding_box(eo_obj, obj, NULL);
990 990
991//// obj->cur->cache.geometry.validity = 0; 991//// obj->cur->cache.geometry.validity = 0;
992 evas_object_change(eo_obj, obj); 992 evas_object_change(eo_obj, obj);
diff --git a/src/lib/evas/canvas/evas_object_smart.c b/src/lib/evas/canvas/evas_object_smart.c
index 7a067d2063..d8e9574952 100644
--- a/src/lib/evas/canvas/evas_object_smart.c
+++ b/src/lib/evas/canvas/evas_object_smart.c
@@ -213,7 +213,7 @@ _evas_object_smart_member_add(Eo *smart_obj, Evas_Smart_Data *o, Evas_Object *eo
213 213
214 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); 214 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
215 Evas_Object_Protected_Data *smart = eo_data_scope_get(smart_obj, EVAS_OBJECT_CLASS); 215 Evas_Object_Protected_Data *smart = eo_data_scope_get(smart_obj, EVAS_OBJECT_CLASS);
216 Evas_Smart_Data *member_o; 216 Evas_Smart_Data *member_o = NULL;
217 217
218 if (obj->delete_me) 218 if (obj->delete_me)
219 { 219 {
@@ -281,7 +281,7 @@ _evas_object_smart_member_add(Eo *smart_obj, Evas_Smart_Data *o, Evas_Object *eo
281 evas_object_mapped_clip_across_mark(eo_obj, obj); 281 evas_object_mapped_clip_across_mark(eo_obj, obj);
282 if (smart->smart.smart && smart->smart.smart->smart_class->member_add) 282 if (smart->smart.smart && smart->smart.smart->smart_class->member_add)
283 smart->smart.smart->smart_class->member_add(smart_obj, eo_obj); 283 smart->smart.smart->smart_class->member_add(smart_obj, eo_obj);
284 evas_object_update_bounding_box(eo_obj, obj); 284 evas_object_update_bounding_box(eo_obj, obj, member_o);
285} 285}
286 286
287EAPI void 287EAPI void
@@ -1090,9 +1090,8 @@ evas_object_smart_del(Evas_Object *eo_obj)
1090} 1090}
1091 1091
1092void 1092void
1093evas_object_update_bounding_box(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) 1093evas_object_update_bounding_box(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Smart_Data *s)
1094{ 1094{
1095 Evas_Smart_Data *s = NULL;
1096 Eina_Bool propagate = EINA_FALSE; 1095 Eina_Bool propagate = EINA_FALSE;
1097 Eina_Bool computeminmax = EINA_FALSE; 1096 Eina_Bool computeminmax = EINA_FALSE;
1098 Evas_Coord x, y, w, h; 1097 Evas_Coord x, y, w, h;
@@ -1108,7 +1107,7 @@ evas_object_update_bounding_box(Evas_Object *eo_obj, Evas_Object_Protected_Data
1108 1107
1109 if (obj->is_smart) 1108 if (obj->is_smart)
1110 { 1109 {
1111 s = eo_data_scope_get(eo_obj, MY_CLASS); 1110 s = s == NULL ? eo_data_scope_get(eo_obj, MY_CLASS) : s;
1112 1111
1113 x = s->cur.bounding_box.x; 1112 x = s->cur.bounding_box.x;
1114 y = s->cur.bounding_box.y; 1113 y = s->cur.bounding_box.y;
@@ -1134,8 +1133,8 @@ evas_object_update_bounding_box(Evas_Object *eo_obj, Evas_Object_Protected_Data
1134 /* We are not yet trying to find the smallest bounding box, but we want to find a good approximation quickly. 1133 /* We are not yet trying to find the smallest bounding box, but we want to find a good approximation quickly.
1135 * That's why we initialiaze min and max search to geometry of the parent object. 1134 * That's why we initialiaze min and max search to geometry of the parent object.
1136 */ 1135 */
1137 Evas_Object_Protected_Data *smart_obj = eo_data_scope_get(obj->smart.parent, EVAS_OBJECT_CLASS); 1136 Evas_Object_Protected_Data *smart_obj = obj->smart.parent_object_data;
1138 Evas_Smart_Data *smart_parent = eo_data_scope_get(obj->smart.parent, MY_CLASS); 1137 Evas_Smart_Data *smart_parent = obj->smart.parent_data;
1139 if (!smart_parent || !smart_obj) return; 1138 if (!smart_parent || !smart_obj) return;
1140 1139
1141 if (smart_obj->cur->valid_bounding_box) 1140 if (smart_obj->cur->valid_bounding_box)
@@ -1223,7 +1222,7 @@ evas_object_update_bounding_box(Evas_Object *eo_obj, Evas_Object_Protected_Data
1223 } 1222 }
1224 1223
1225 if (propagate) 1224 if (propagate)
1226 evas_object_update_bounding_box(obj->smart.parent, smart_obj); 1225 evas_object_update_bounding_box(obj->smart.parent, smart_obj, smart_parent);
1227} 1226}
1228 1227
1229void 1228void
diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c
index ea32a906ac..95015cb3dc 100644
--- a/src/lib/evas/canvas/evas_render.c
+++ b/src/lib/evas/canvas/evas_render.c
@@ -578,7 +578,7 @@ _evas_render_phase1_object_process(Evas_Public_Data *e, Evas_Object *eo_obj,
578 evas_object_change(obj->cur->clipper->object, obj->cur->clipper); 578 evas_object_change(obj->cur->clipper->object, obj->cur->clipper);
579 evas_object_clip_dirty(obj->cur->clipper->object, obj->cur->clipper); 579 evas_object_clip_dirty(obj->cur->clipper->object, obj->cur->clipper);
580 evas_object_clip_recalc(obj->cur->clipper); 580 evas_object_clip_recalc(obj->cur->clipper);
581 evas_object_update_bounding_box(eo_obj, obj); 581 evas_object_update_bounding_box(eo_obj, obj, NULL);
582 } 582 }
583 if (obj->changed) 583 if (obj->changed)
584 { 584 {
@@ -638,7 +638,7 @@ _evas_render_phase1_object_process(Evas_Public_Data *e, Evas_Object *eo_obj,
638 evas_object_change(obj->cur->clipper->object, obj->cur->clipper); 638 evas_object_change(obj->cur->clipper->object, obj->cur->clipper);
639 evas_object_clip_dirty(obj->cur->clipper->object, obj->cur->clipper); 639 evas_object_clip_dirty(obj->cur->clipper->object, obj->cur->clipper);
640 evas_object_clip_recalc(obj->cur->clipper); 640 evas_object_clip_recalc(obj->cur->clipper);
641 evas_object_update_bounding_box(eo_obj, obj); 641 evas_object_update_bounding_box(eo_obj, obj, NULL);
642 } 642 }
643 } 643 }
644 644
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index 983e84eb44..78102c4c9e 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -1518,7 +1518,7 @@ Evas_Object *evas_object_new(Evas *e);
1518void evas_object_change_reset(Evas_Object *obj); 1518void evas_object_change_reset(Evas_Object *obj);
1519void evas_object_cur_prev(Evas_Object *obj); 1519void evas_object_cur_prev(Evas_Object *obj);
1520void evas_object_free(Evas_Object *obj, int clean_layer); 1520void evas_object_free(Evas_Object *obj, int clean_layer);
1521void evas_object_update_bounding_box(Evas_Object *obj, Evas_Object_Protected_Data *pd); 1521void evas_object_update_bounding_box(Evas_Object *obj, Evas_Object_Protected_Data *pd, Evas_Smart_Data *s);
1522void evas_object_inject(Evas_Object *obj, Evas_Object_Protected_Data *pd, Evas *e); 1522void evas_object_inject(Evas_Object *obj, Evas_Object_Protected_Data *pd, Evas *e);
1523void evas_object_release(Evas_Object *obj, Evas_Object_Protected_Data *pd, int clean_layer); 1523void evas_object_release(Evas_Object *obj, Evas_Object_Protected_Data *pd, int clean_layer);
1524void evas_object_change(Evas_Object *obj, Evas_Object_Protected_Data *pd); 1524void 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);
1575void _evas_object_image_video_overlay_do(Evas_Object *obj); 1575void _evas_object_image_video_overlay_do(Evas_Object *obj);
1576void _evas_object_image_free(Evas_Object *obj); 1576void _evas_object_image_free(Evas_Object *obj);
1577void evas_object_smart_bounding_box_get(Evas_Object *eo_obj, 1577void evas_object_smart_bounding_box_get(Evas_Object *eo_obj,
1578 Evas_Coord_Rectangle *cur_bounding_box, 1578 Evas_Coord_Rectangle *cur_bounding_box,
1579 Evas_Coord_Rectangle *prev_bounding_box); 1579 Evas_Coord_Rectangle *prev_bounding_box);
1580void evas_object_update_bounding_box(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj);
1581void evas_object_smart_del(Evas_Object *obj); 1580void evas_object_smart_del(Evas_Object *obj);
1582void evas_object_smart_cleanup(Evas_Object *obj); 1581void evas_object_smart_cleanup(Evas_Object *obj);
1583void evas_object_smart_member_raise(Evas_Object *member); 1582void evas_object_smart_member_raise(Evas_Object *member);