summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-02-20 19:34:58 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-02-21 10:52:40 +0900
commit0d555dda7f2f8cb86d097ca713aa5ca61aac4ff7 (patch)
treef2f0fabe3e105ab61ff7ed535b659ecdf33463d1 /src/lib
parent98092224ef6265f27cc6b8fd58da8ce8cf9850d3 (diff)
evas: Optimize out some calls to data_scope_get
Within evas when we know an object is marked as is_smart, then we know it's a smart object. :) @optimize
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/evas/canvas/evas_events.c12
-rw-r--r--src/lib/evas/canvas/evas_object_main.c4
-rw-r--r--src/lib/evas/canvas/evas_object_smart.c41
-rw-r--r--src/lib/evas/canvas/evas_render.c4
-rw-r--r--src/lib/evas/include/evas_private.h6
5 files changed, 28 insertions, 39 deletions
diff --git a/src/lib/evas/canvas/evas_events.c b/src/lib/evas/canvas/evas_events.c
index aa0c9e7c0c..a53bb12d85 100644
--- a/src/lib/evas/canvas/evas_events.c
+++ b/src/lib/evas/canvas/evas_events.c
@@ -146,8 +146,8 @@ _evas_event_object_list_raw_in_get(Evas *eo_e, Eina_List *in,
146 { 146 {
147 Evas_Coord_Rectangle bounding_box = { 0, 0, 0, 0 }; 147 Evas_Coord_Rectangle bounding_box = { 0, 0, 0, 0 };
148 148
149 evas_object_smart_bounding_box_update(eo_obj, obj); 149 evas_object_smart_bounding_box_update(obj);
150 evas_object_smart_bounding_box_get(obj->object, &bounding_box, NULL); 150 evas_object_smart_bounding_box_get(obj, &bounding_box, NULL);
151 c = bounding_box; 151 c = bounding_box;
152 } 152 }
153 else 153 else
@@ -164,7 +164,7 @@ _evas_event_object_list_raw_in_get(Evas *eo_e, Eina_List *in,
164 { 164 {
165 Evas_Coord_Rectangle bounding_box = { 0, 0, 0, 0 }; 165 Evas_Coord_Rectangle bounding_box = { 0, 0, 0, 0 };
166 166
167 evas_object_smart_bounding_box_get(obj->object, &bounding_box, NULL); 167 evas_object_smart_bounding_box_get(obj, &bounding_box, NULL);
168 DDD("___ %p g[%6i %6i %6ix%6i] c[%6i %6i %6ix%6i] b[%6i %6i %6ix%6i] %s\n", 168 DDD("___ %p g[%6i %6i %6ix%6i] c[%6i %6i %6ix%6i] b[%6i %6i %6ix%6i] %s\n",
169 obj->object, 169 obj->object,
170 obj->cur->geometry.x, obj->cur->geometry.y, 170 obj->cur->geometry.x, obj->cur->geometry.y,
@@ -200,7 +200,7 @@ _evas_event_object_list_raw_in_get(Evas *eo_e, Eina_List *in,
200 { 200 {
201 Evas_Coord_Rectangle bounding_box = { 0, 0, 0, 0 }; 201 Evas_Coord_Rectangle bounding_box = { 0, 0, 0, 0 };
202 202
203 evas_object_smart_bounding_box_get(obj->object, &bounding_box, NULL); 203 evas_object_smart_bounding_box_get(obj, &bounding_box, NULL);
204 DDD("OBJ %p g[%6i %6i %6ix%6i] c[%6i %6i %6ix%6i] b[%6i %6i %6ix%6i] %s\n", 204 DDD("OBJ %p g[%6i %6i %6ix%6i] c[%6i %6i %6ix%6i] b[%6i %6i %6ix%6i] %s\n",
205 obj->object, 205 obj->object,
206 obj->cur->geometry.x, obj->cur->geometry.y, 206 obj->cur->geometry.x, obj->cur->geometry.y,
@@ -277,9 +277,9 @@ _evas_event_object_list_raw_in_get(Evas *eo_e, Eina_List *in,
277 Evas_Coord_Rectangle bounding_box = { 0, 0, 0, 0 }; 277 Evas_Coord_Rectangle bounding_box = { 0, 0, 0, 0 };
278 278
279 if (!obj->child_has_map) 279 if (!obj->child_has_map)
280 evas_object_smart_bounding_box_update(eo_obj, obj); 280 evas_object_smart_bounding_box_update(obj);
281 281
282 evas_object_smart_bounding_box_get(eo_obj, &bounding_box, NULL); 282 evas_object_smart_bounding_box_get(obj, &bounding_box, NULL);
283 283
284 if (obj->child_has_map || 284 if (obj->child_has_map ||
285 (bounding_box.x <= x && 285 (bounding_box.x <= x &&
diff --git a/src/lib/evas/canvas/evas_object_main.c b/src/lib/evas/canvas/evas_object_main.c
index a95db83b0a..293d71c6fc 100644
--- a/src/lib/evas/canvas/evas_object_main.c
+++ b/src/lib/evas/canvas/evas_object_main.c
@@ -244,8 +244,8 @@ evas_object_clip_recalc(Evas_Object_Protected_Data *obj)
244 { 244 {
245 Evas_Coord_Rectangle bounding_box; 245 Evas_Coord_Rectangle bounding_box;
246 246
247 evas_object_smart_bounding_box_update(eo_obj, obj); 247 evas_object_smart_bounding_box_update(obj);
248 evas_object_smart_bounding_box_get(eo_obj, &bounding_box, NULL); 248 evas_object_smart_bounding_box_get(obj, &bounding_box, NULL);
249 cx = bounding_box.x; 249 cx = bounding_box.x;
250 cy = bounding_box.y; 250 cy = bounding_box.y;
251 cw = bounding_box.w; 251 cw = bounding_box.w;
diff --git a/src/lib/evas/canvas/evas_object_smart.c b/src/lib/evas/canvas/evas_object_smart.c
index ca95b6e83a..870955ba4e 100644
--- a/src/lib/evas/canvas/evas_object_smart.c
+++ b/src/lib/evas/canvas/evas_object_smart.c
@@ -1118,7 +1118,7 @@ evas_object_smart_del(Evas_Object *eo_obj)
1118} 1118}
1119 1119
1120void 1120void
1121evas_object_update_bounding_box(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Smart_Data *s) 1121evas_object_update_bounding_box(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Evas_Smart_Data *s)
1122{ 1122{
1123 Eina_Bool propagate = EINA_FALSE; 1123 Eina_Bool propagate = EINA_FALSE;
1124 Eina_Bool computeminmax = EINA_FALSE; 1124 Eina_Bool computeminmax = EINA_FALSE;
@@ -1135,7 +1135,7 @@ evas_object_update_bounding_box(Evas_Object *eo_obj, Evas_Object_Protected_Data
1135 1135
1136 if (obj->is_smart) 1136 if (obj->is_smart)
1137 { 1137 {
1138 s = s == NULL ? efl_data_scope_get(eo_obj, MY_CLASS) : s; 1138 if (!s) s = obj->private_data;
1139 1139
1140 x = s->cur.bounding_box.x; 1140 x = s->cur.bounding_box.x;
1141 y = s->cur.bounding_box.y; 1141 y = s->cur.bounding_box.y;
@@ -1226,8 +1226,7 @@ evas_object_update_bounding_box(Evas_Object *eo_obj, Evas_Object_Protected_Data
1226 1226
1227 if (computeminmax) 1227 if (computeminmax)
1228 { 1228 {
1229 evas_object_smart_need_bounding_box_update(obj->smart.parent, 1229 evas_object_smart_need_bounding_box_update(obj->smart.parent_data,
1230 obj->smart.parent_data,
1231 obj->smart.parent_object_data); 1230 obj->smart.parent_object_data);
1232 } 1231 }
1233 } 1232 }
@@ -1253,11 +1252,11 @@ evas_object_update_bounding_box(Evas_Object *eo_obj, Evas_Object_Protected_Data
1253} 1252}
1254 1253
1255void 1254void
1256evas_object_smart_bounding_box_get(Evas_Object *eo_obj, 1255evas_object_smart_bounding_box_get(Evas_Object_Protected_Data *obj,
1257 Evas_Coord_Rectangle *cur_bounding_box, 1256 Evas_Coord_Rectangle *cur_bounding_box,
1258 Evas_Coord_Rectangle *prev_bounding_box) 1257 Evas_Coord_Rectangle *prev_bounding_box)
1259{ 1258{
1260 Evas_Smart_Data *s = efl_data_scope_get(eo_obj, MY_CLASS); 1259 Evas_Smart_Data *s = obj->private_data;
1261 1260
1262 if (cur_bounding_box) memcpy(cur_bounding_box, 1261 if (cur_bounding_box) memcpy(cur_bounding_box,
1263 &s->cur.bounding_box, 1262 &s->cur.bounding_box,
@@ -1416,29 +1415,24 @@ evas_object_smart_member_stack_below(Evas_Object *eo_member, Evas_Object *eo_oth
1416} 1415}
1417 1416
1418void 1417void
1419evas_object_smart_need_bounding_box_update(Evas_Object *eo_obj, Evas_Smart_Data *o, Evas_Object_Protected_Data *obj) 1418evas_object_smart_need_bounding_box_update(Evas_Smart_Data *o, Evas_Object_Protected_Data *obj)
1420{ 1419{
1421 MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
1422 return;
1423 MAGIC_CHECK_END();
1424
1425 evas_object_async_block(obj);
1426 if (o->update_boundingbox_needed) return; 1420 if (o->update_boundingbox_needed) return;
1427 o->update_boundingbox_needed = EINA_TRUE; 1421 o->update_boundingbox_needed = EINA_TRUE;
1428 EINA_COW_STATE_WRITE_BEGIN(obj, state_write, cur) 1422 if (!obj->cur->cache.clip.dirty)
1429 { 1423 {
1430 state_write->cache.clip.dirty = EINA_TRUE; 1424 EINA_COW_STATE_WRITE_BEGIN(obj, state_write, cur)
1425 state_write->cache.clip.dirty = EINA_TRUE;
1426 EINA_COW_STATE_WRITE_END(obj, state_write, cur);
1431 } 1427 }
1432 EINA_COW_STATE_WRITE_END(obj, state_write, cur);
1433 1428
1434 if (obj->smart.parent) 1429 if (obj->smart.parent)
1435 evas_object_smart_need_bounding_box_update(obj->smart.parent, 1430 evas_object_smart_need_bounding_box_update(obj->smart.parent_data,
1436 obj->smart.parent_data,
1437 obj->smart.parent_object_data); 1431 obj->smart.parent_object_data);
1438} 1432}
1439 1433
1440void 1434void
1441evas_object_smart_bounding_box_update(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) 1435evas_object_smart_bounding_box_update(Evas_Object_Protected_Data *obj)
1442{ 1436{
1443 Evas_Smart_Data *os; 1437 Evas_Smart_Data *os;
1444 Eina_Inlist *list; 1438 Eina_Inlist *list;
@@ -1450,12 +1444,7 @@ evas_object_smart_bounding_box_update(Evas_Object *eo_obj, Evas_Object_Protected
1450 Evas_Coord tx1, ty1, tx2, ty2; 1444 Evas_Coord tx1, ty1, tx2, ty2;
1451 Eina_Bool none = EINA_TRUE; 1445 Eina_Bool none = EINA_TRUE;
1452 1446
1453 MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ); 1447 os = obj->private_data;
1454 return;
1455 MAGIC_CHECK_END();
1456
1457 evas_object_async_block(obj);
1458 os = efl_data_scope_get(eo_obj, MY_CLASS);
1459 1448
1460 if (!os->update_boundingbox_needed) return; 1449 if (!os->update_boundingbox_needed) return;
1461 os->update_boundingbox_needed = EINA_FALSE; 1450 os->update_boundingbox_needed = EINA_FALSE;
@@ -1471,9 +1460,9 @@ evas_object_smart_bounding_box_update(Evas_Object *eo_obj, Evas_Object_Protected
1471 1460
1472 if (o->is_smart) 1461 if (o->is_smart)
1473 { 1462 {
1474 Evas_Smart_Data *s = efl_data_scope_get(o->object, MY_CLASS); 1463 Evas_Smart_Data *s = o->private_data;
1475 1464
1476 evas_object_smart_bounding_box_update(o->object, o); 1465 evas_object_smart_bounding_box_update(o);
1477 1466
1478 tx1 = s->cur.bounding_box.x; 1467 tx1 = s->cur.bounding_box.x;
1479 ty1 = s->cur.bounding_box.y; 1468 ty1 = s->cur.bounding_box.y;
diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c
index df7e8fc3c0..54690dc3c9 100644
--- a/src/lib/evas/canvas/evas_render.c
+++ b/src/lib/evas/canvas/evas_render.c
@@ -1073,7 +1073,7 @@ _evas_render_phase1_object_process(Phase1_Context *p1ctx,
1073 1073
1074#ifdef INLINE_ACTIVE_GEOM 1074#ifdef INLINE_ACTIVE_GEOM
1075 if (obj->is_smart) 1075 if (obj->is_smart)
1076 evas_object_smart_bounding_box_get(eo_obj, &(ent.rect), NULL); 1076 evas_object_smart_bounding_box_get(obj, &(ent.rect), NULL);
1077 else 1077 else
1078 { 1078 {
1079 ent.rect.x = obj->cur->cache.clip.x; 1079 ent.rect.x = obj->cur->cache.clip.x;
@@ -2716,7 +2716,7 @@ _is_obj_in_rect(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj,
2716 { 2716 {
2717 Evas_Coord_Rectangle rect; 2717 Evas_Coord_Rectangle rect;
2718 2718
2719 evas_object_smart_bounding_box_get(eo_obj, &rect, NULL); 2719 evas_object_smart_bounding_box_get(obj, &rect, NULL);
2720 if (RECTS_INTERSECT(x, y, w, h, rect.x, rect.y, rect.w, rect.h)) 2720 if (RECTS_INTERSECT(x, y, w, h, rect.x, rect.y, rect.w, rect.h))
2721 return EINA_TRUE; 2721 return EINA_TRUE;
2722 } 2722 }
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index 8b448124b9..dbdff9e4ff 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -1664,7 +1664,7 @@ void _evas_object_image_video_overlay_show(Evas_Object *obj);
1664void _evas_object_image_video_overlay_hide(Evas_Object *obj); 1664void _evas_object_image_video_overlay_hide(Evas_Object *obj);
1665void _evas_object_image_video_overlay_do(Evas_Object *obj); 1665void _evas_object_image_video_overlay_do(Evas_Object *obj);
1666void _evas_object_image_free(Evas_Object *obj); 1666void _evas_object_image_free(Evas_Object *obj);
1667void evas_object_smart_bounding_box_get(Evas_Object *eo_obj, 1667void evas_object_smart_bounding_box_get(Evas_Object_Protected_Data *obj,
1668 Evas_Coord_Rectangle *cur_bounding_box, 1668 Evas_Coord_Rectangle *cur_bounding_box,
1669 Evas_Coord_Rectangle *prev_bounding_box); 1669 Evas_Coord_Rectangle *prev_bounding_box);
1670void evas_object_smart_del(Evas_Object *obj); 1670void evas_object_smart_del(Evas_Object *obj);
@@ -1681,8 +1681,8 @@ const Eina_Inlist *evas_object_smart_members_get_direct(const Evas_Object *obj);
1681void _efl_canvas_group_group_members_all_del(Evas_Object *eo_obj); 1681void _efl_canvas_group_group_members_all_del(Evas_Object *eo_obj);
1682void _evas_object_smart_clipped_smart_move_internal(Evas_Object *eo_obj, Evas_Coord x, Evas_Coord y); 1682void _evas_object_smart_clipped_smart_move_internal(Evas_Object *eo_obj, Evas_Coord x, Evas_Coord y);
1683void evas_call_smarts_calculate(Evas *e); 1683void evas_call_smarts_calculate(Evas *e);
1684void evas_object_smart_bounding_box_update(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); 1684void evas_object_smart_bounding_box_update(Evas_Object_Protected_Data *obj);
1685void evas_object_smart_need_bounding_box_update(Evas_Object *eo_obj, Evas_Smart_Data *o, Evas_Object_Protected_Data *obj); 1685void evas_object_smart_need_bounding_box_update(Evas_Smart_Data *o, Evas_Object_Protected_Data *obj);
1686Eina_Bool evas_object_smart_changed_get(Evas_Object *eo_obj); 1686Eina_Bool evas_object_smart_changed_get(Evas_Object *eo_obj);
1687void evas_object_smart_attach(Evas_Object *eo_obj, Evas_Smart *s); 1687void evas_object_smart_attach(Evas_Object *eo_obj, Evas_Smart *s);
1688void *evas_mem_calloc(int size); 1688void *evas_mem_calloc(int size);