summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-02-20 18:07:00 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-02-21 10:52:39 +0900
commitd150cdfd9d3ef32cceaf2db93a57f9b4a53aaf55 (patch)
treee7be95b15f784c1ab4375edd7e28c12020c9a522 /src/lib
parent9a83113b9f2864d3e9f4c133d6cb61330ba8c454 (diff)
evas: Assume object is valid and avoid call to efl_isa
In an internal function we should be able to safely assume an object is indeed a smart object. @optimization
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/evas/canvas/evas_layer.c2
-rw-r--r--src/lib/evas/canvas/evas_object_main.c1
-rw-r--r--src/lib/evas/canvas/evas_object_smart.c14
-rw-r--r--src/lib/evas/canvas/evas_render.c2
-rw-r--r--src/lib/evas/canvas/render2/evas_render2_old.c6
-rw-r--r--src/lib/evas/canvas/render2/evas_render2_th_main.c2
-rw-r--r--src/lib/evas/canvas/render2/evas_render2_updates_old.c2
7 files changed, 14 insertions, 15 deletions
diff --git a/src/lib/evas/canvas/evas_layer.c b/src/lib/evas/canvas/evas_layer.c
index 11bbe033ac..a92f6d7a0a 100644
--- a/src/lib/evas/canvas/evas_layer.c
+++ b/src/lib/evas/canvas/evas_layer.c
@@ -252,7 +252,7 @@ _efl_canvas_object_efl_gfx_stack_layer_set(Eo *eo_obj, Evas_Object_Protected_Dat
252 1, 1, EINA_TRUE, 252 1, 1, EINA_TRUE,
253 NULL); 253 NULL);
254 } 254 }
255 else 255 else if (obj->is_smart)
256 { 256 {
257 Eina_Inlist *contained; 257 Eina_Inlist *contained;
258 Evas_Object_Protected_Data *member; 258 Evas_Object_Protected_Data *member;
diff --git a/src/lib/evas/canvas/evas_object_main.c b/src/lib/evas/canvas/evas_object_main.c
index 77cc16b6b8..a95db83b0a 100644
--- a/src/lib/evas/canvas/evas_object_main.c
+++ b/src/lib/evas/canvas/evas_object_main.c
@@ -2402,6 +2402,7 @@ _is_frame_flag_set(Evas_Object_Protected_Data *obj, Eina_Bool is_frame)
2402 2402
2403 obj->is_frame = is_frame; 2403 obj->is_frame = is_frame;
2404 2404
2405 if (!obj->is_smart) return;
2405 l = evas_object_smart_members_get_direct(obj->object); 2406 l = evas_object_smart_members_get_direct(obj->object);
2406 2407
2407 EINA_INLIST_FOREACH(l, child) 2408 EINA_INLIST_FOREACH(l, child)
diff --git a/src/lib/evas/canvas/evas_object_smart.c b/src/lib/evas/canvas/evas_object_smart.c
index 527908930c..ca95b6e83a 100644
--- a/src/lib/evas/canvas/evas_object_smart.c
+++ b/src/lib/evas/canvas/evas_object_smart.c
@@ -508,10 +508,6 @@ evas_object_smart_render_cache_set(Evas_Object *eo_obj, void *data)
508const Eina_Inlist * 508const Eina_Inlist *
509evas_object_smart_members_get_direct(const Evas_Object *eo_obj) 509evas_object_smart_members_get_direct(const Evas_Object *eo_obj)
510{ 510{
511 MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
512 return NULL;
513 MAGIC_CHECK_END();
514 if (!efl_isa(eo_obj, MY_CLASS)) return NULL;
515 Evas_Smart_Data *o = efl_data_scope_get(eo_obj, MY_CLASS); 511 Evas_Smart_Data *o = efl_data_scope_get(eo_obj, MY_CLASS);
516 if (!o) return NULL; 512 if (!o) return NULL;
517 return o->contained; 513 return o->contained;
@@ -1040,7 +1036,6 @@ Eina_Bool
1040evas_object_smart_changed_get(Evas_Object *eo_obj) 1036evas_object_smart_changed_get(Evas_Object *eo_obj)
1041{ 1037{
1042 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); 1038 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
1043 Evas_Object_Protected_Data *o2;
1044 Eina_Bool has_map = EINA_FALSE; 1039 Eina_Bool has_map = EINA_FALSE;
1045 1040
1046 /* If object is invisible, it's meaningless to figure out changed state 1041 /* If object is invisible, it's meaningless to figure out changed state
@@ -1072,8 +1067,13 @@ evas_object_smart_changed_get(Evas_Object *eo_obj)
1072 } 1067 }
1073 } 1068 }
1074 1069
1075 EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(eo_obj), o2) 1070 if (obj->is_smart)
1076 if (evas_object_smart_changed_get(o2->object)) return EINA_TRUE; 1071 {
1072 Evas_Object_Protected_Data *o2;
1073
1074 EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(eo_obj), o2)
1075 if (evas_object_smart_changed_get(o2->object)) return EINA_TRUE;
1076 }
1077 1077
1078 return EINA_FALSE; 1078 return EINA_FALSE;
1079} 1079}
diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c
index 65874e37a5..df7e8fc3c0 100644
--- a/src/lib/evas/canvas/evas_render.c
+++ b/src/lib/evas/canvas/evas_render.c
@@ -472,7 +472,7 @@ _evas_render_phase1_direct(Evas_Public_Data *e,
472 472
473 RD(0, " pre-render-done smart:%p|%p [%p, %i] | [%p, %i] has_map:%i had_map:%i\n", 473 RD(0, " pre-render-done smart:%p|%p [%p, %i] | [%p, %i] has_map:%i had_map:%i\n",
474 obj->smart.smart, 474 obj->smart.smart,
475 evas_object_smart_members_get_direct(eo_obj), 475 obj->is_smart ? evas_object_smart_members_get_direct(eo_obj) : NULL,
476 obj->map->cur.map, obj->map->cur.usemap, 476 obj->map->cur.map, obj->map->cur.usemap,
477 obj->map->prev.map, obj->map->prev.usemap, 477 obj->map->prev.map, obj->map->prev.usemap,
478 _evas_render_has_map(obj), 478 _evas_render_has_map(obj),
diff --git a/src/lib/evas/canvas/render2/evas_render2_old.c b/src/lib/evas/canvas/render2/evas_render2_old.c
index b486bae01a..71eb7307b0 100644
--- a/src/lib/evas/canvas/render2/evas_render2_old.c
+++ b/src/lib/evas/canvas/render2/evas_render2_old.c
@@ -230,14 +230,12 @@ _evas_render2_object_render(Evas_Public_Data *e, Evas_Object_Protected_Data *obj
230{ 230{
231 Evas_Object_Protected_Data *obj2; 231 Evas_Object_Protected_Data *obj2;
232 Evas_Object *eo_obj = obj->object; 232 Evas_Object *eo_obj = obj->object;
233 const Eina_Inlist *il;
234 233
235 if ((!evas_object_is_visible(eo_obj, obj)) || 234 if ((!evas_object_is_visible(eo_obj, obj)) ||
236 (obj->clip.clipees) || (obj->cur->have_clipees)) return; 235 (obj->clip.clipees) || (obj->cur->have_clipees)) return;
237 il = evas_object_smart_members_get_direct(eo_obj); 236 if (obj->is_smart)
238 if (il)
239 { 237 {
240 EINA_INLIST_FOREACH(il, obj2) 238 EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(eo_obj), obj2)
241 _evas_render2_object_render(e, obj2, uinf, l + 1); 239 _evas_render2_object_render(e, obj2, uinf, l + 1);
242 } 240 }
243 else 241 else
diff --git a/src/lib/evas/canvas/render2/evas_render2_th_main.c b/src/lib/evas/canvas/render2/evas_render2_th_main.c
index 1a7b3a4ef9..e3039776dd 100644
--- a/src/lib/evas/canvas/render2/evas_render2_th_main.c
+++ b/src/lib/evas/canvas/render2/evas_render2_th_main.c
@@ -142,7 +142,7 @@ _evas_render2_th_main_obj_walk_process(Evas_Public_Data *e,
142 Evas_Object *eo_obj = obj->object; 142 Evas_Object *eo_obj = obj->object;
143 const Eina_Inlist *il; 143 const Eina_Inlist *il;
144 144
145 il = evas_object_smart_members_get_direct(eo_obj); 145 il = obj->is_smart ? evas_object_smart_members_get_direct(eo_obj) : NULL;
146 if (il) 146 if (il)
147 { 147 {
148 if (!_evas_render2_th_main_obj_del_handle(e, obj)) return; 148 if (!_evas_render2_th_main_obj_del_handle(e, obj)) return;
diff --git a/src/lib/evas/canvas/render2/evas_render2_updates_old.c b/src/lib/evas/canvas/render2/evas_render2_updates_old.c
index 5ab650bc91..58fa4a1c63 100644
--- a/src/lib/evas/canvas/render2/evas_render2_updates_old.c
+++ b/src/lib/evas/canvas/render2/evas_render2_updates_old.c
@@ -32,7 +32,7 @@ _obj_process(Evas_Public_Data *e,
32 const Eina_Inlist *il; 32 const Eina_Inlist *il;
33 33
34 if (!obj->changed) return; 34 if (!obj->changed) return;
35 il = evas_object_smart_members_get_direct(eo_obj); 35 il = obj->is_smart ? evas_object_smart_members_get_direct(eo_obj) : NULL;
36 if (il) 36 if (il)
37 { 37 {
38 obj->rect_del = EINA_FALSE; 38 obj->rect_del = EINA_FALSE;