diff options
author | Cedric BAIL <cedric@osg.samsung.com> | 2016-05-06 16:47:07 -0700 |
---|---|---|
committer | Cedric BAIL <cedric@osg.samsung.com> | 2016-05-06 16:47:07 -0700 |
commit | 4bf54d993fa4d0d0b56d24555f5a674ffbc9b232 (patch) | |
tree | 5b7cf340720d82cd0f1e0be8968b452866fb8034 | |
parent | c9152d38162866b203236296ef1a67270ec1d23d (diff) |
evas: cache result of eo_data_scope_get that are heavily used.
This alone save a good 3% time to our first frame being displayed.
-rw-r--r-- | src/lib/evas/canvas/evas_object_smart.c | 15 | ||||
-rw-r--r-- | src/lib/evas/include/evas_private.h | 6 |
2 files changed, 15 insertions, 6 deletions
diff --git a/src/lib/evas/canvas/evas_object_smart.c b/src/lib/evas/canvas/evas_object_smart.c index 752f349389..7a067d2063 100644 --- a/src/lib/evas/canvas/evas_object_smart.c +++ b/src/lib/evas/canvas/evas_object_smart.c | |||
@@ -257,6 +257,8 @@ _evas_object_smart_member_add(Eo *smart_obj, Evas_Smart_Data *o, Evas_Object *eo | |||
257 | 257 | ||
258 | obj->layer->usage++; | 258 | obj->layer->usage++; |
259 | obj->smart.parent = smart_obj; | 259 | obj->smart.parent = smart_obj; |
260 | obj->smart.parent_data = o; | ||
261 | obj->smart.parent_object_data = smart; | ||
260 | o->contained = eina_inlist_append(o->contained, EINA_INLIST_GET(obj)); | 262 | o->contained = eina_inlist_append(o->contained, EINA_INLIST_GET(obj)); |
261 | eo_data_ref(eo_obj, NULL); | 263 | eo_data_ref(eo_obj, NULL); |
262 | evas_object_smart_member_cache_invalidate(eo_obj, EINA_TRUE, EINA_TRUE, | 264 | evas_object_smart_member_cache_invalidate(eo_obj, EINA_TRUE, EINA_TRUE, |
@@ -1198,7 +1200,9 @@ evas_object_update_bounding_box(Evas_Object *eo_obj, Evas_Object_Protected_Data | |||
1198 | 1200 | ||
1199 | if (computeminmax) | 1201 | if (computeminmax) |
1200 | { | 1202 | { |
1201 | evas_object_smart_need_bounding_box_update(obj->smart.parent); | 1203 | evas_object_smart_need_bounding_box_update(obj->smart.parent, |
1204 | obj->smart.parent_data, | ||
1205 | obj->smart.parent_object_data); | ||
1202 | } | 1206 | } |
1203 | } | 1207 | } |
1204 | else | 1208 | else |
@@ -1345,19 +1349,20 @@ evas_object_smart_member_stack_below(Evas_Object *eo_member, Evas_Object *eo_oth | |||
1345 | } | 1349 | } |
1346 | 1350 | ||
1347 | void | 1351 | void |
1348 | evas_object_smart_need_bounding_box_update(Evas_Object *eo_obj) | 1352 | evas_object_smart_need_bounding_box_update(Evas_Object *eo_obj, Evas_Smart_Data *o, Evas_Object_Protected_Data *obj) |
1349 | { | 1353 | { |
1350 | MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ); | 1354 | MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ); |
1351 | return; | 1355 | return; |
1352 | MAGIC_CHECK_END(); | 1356 | MAGIC_CHECK_END(); |
1353 | Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); | ||
1354 | Evas_Smart_Data *o = eo_data_scope_get(eo_obj, MY_CLASS); | ||
1355 | 1357 | ||
1356 | evas_object_async_block(obj); | 1358 | evas_object_async_block(obj); |
1357 | if (o->update_boundingbox_needed) return; | 1359 | if (o->update_boundingbox_needed) return; |
1358 | o->update_boundingbox_needed = EINA_TRUE; | 1360 | o->update_boundingbox_needed = EINA_TRUE; |
1359 | 1361 | ||
1360 | if (obj->smart.parent) evas_object_smart_need_bounding_box_update(obj->smart.parent); | 1362 | if (obj->smart.parent) |
1363 | evas_object_smart_need_bounding_box_update(obj->smart.parent, | ||
1364 | obj->smart.parent_data, | ||
1365 | obj->smart.parent_object_data); | ||
1361 | } | 1366 | } |
1362 | 1367 | ||
1363 | void | 1368 | void |
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h index b8d5f9c1a2..983e84eb44 100644 --- a/src/lib/evas/include/evas_private.h +++ b/src/lib/evas/include/evas_private.h | |||
@@ -80,6 +80,8 @@ typedef struct _Evas_Proxy_Render_Data Evas_Proxy_Render_Data; | |||
80 | typedef struct _Evas_Object_3D_Data Evas_Object_3D_Data; | 80 | typedef struct _Evas_Object_3D_Data Evas_Object_3D_Data; |
81 | typedef struct _Evas_Object_Mask_Data Evas_Object_Mask_Data; | 81 | typedef struct _Evas_Object_Mask_Data Evas_Object_Mask_Data; |
82 | 82 | ||
83 | typedef struct _Evas_Smart_Data Evas_Smart_Data; | ||
84 | |||
83 | typedef struct _Evas_Object_Protected_State Evas_Object_Protected_State; | 85 | typedef struct _Evas_Object_Protected_State Evas_Object_Protected_State; |
84 | typedef struct _Evas_Object_Protected_Data Evas_Object_Protected_Data; | 86 | typedef struct _Evas_Object_Protected_Data Evas_Object_Protected_Data; |
85 | 87 | ||
@@ -1077,6 +1079,8 @@ struct _Evas_Object_Protected_Data | |||
1077 | struct { | 1079 | struct { |
1078 | Evas_Smart *smart; | 1080 | Evas_Smart *smart; |
1079 | Evas_Object *parent; | 1081 | Evas_Object *parent; |
1082 | Evas_Smart_Data *parent_data; | ||
1083 | Evas_Object_Protected_Data *parent_object_data; | ||
1080 | } smart; | 1084 | } smart; |
1081 | 1085 | ||
1082 | // Eina_Cow pointer be careful when writing to it | 1086 | // Eina_Cow pointer be careful when writing to it |
@@ -1584,7 +1588,7 @@ const Eina_Inlist *evas_object_smart_members_get_direct(const Evas_Object *obj); | |||
1584 | void _evas_object_smart_members_all_del(Evas_Object *obj); | 1588 | void _evas_object_smart_members_all_del(Evas_Object *obj); |
1585 | void evas_call_smarts_calculate(Evas *e); | 1589 | void evas_call_smarts_calculate(Evas *e); |
1586 | void evas_object_smart_bounding_box_update(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); | 1590 | void evas_object_smart_bounding_box_update(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); |
1587 | void evas_object_smart_need_bounding_box_update(Evas_Object *obj); | 1591 | void evas_object_smart_need_bounding_box_update(Evas_Object *eo_obj, Evas_Smart_Data *o, Evas_Object_Protected_Data *obj); |
1588 | Eina_Bool evas_object_smart_changed_get(Evas_Object *eo_obj); | 1592 | Eina_Bool evas_object_smart_changed_get(Evas_Object *eo_obj); |
1589 | void *evas_mem_calloc(int size); | 1593 | void *evas_mem_calloc(int size); |
1590 | void _evas_post_event_callback_call(Evas *e, Evas_Public_Data* e_pd); | 1594 | void _evas_post_event_callback_call(Evas *e, Evas_Public_Data* e_pd); |