cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=4bf54d993fa4d0d0b56d24555f5a674ffbc9b232

commit 4bf54d993fa4d0d0b56d24555f5a674ffbc9b232
Author: Cedric BAIL <ced...@osg.samsung.com>
Date:   Fri May 6 16:47:07 2016 -0700

    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.
---
 src/lib/evas/canvas/evas_object_smart.c | 15 ++++++++++-----
 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 752f349..7a067d2 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
 
    obj->layer->usage++;
    obj->smart.parent = smart_obj;
+   obj->smart.parent_data = o;
+   obj->smart.parent_object_data = smart;
    o->contained = eina_inlist_append(o->contained, EINA_INLIST_GET(obj));
    eo_data_ref(eo_obj, NULL);
    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
 
        if (computeminmax)
           {
-             evas_object_smart_need_bounding_box_update(obj->smart.parent);
+             evas_object_smart_need_bounding_box_update(obj->smart.parent,
+                                                        obj->smart.parent_data,
+                                                        
obj->smart.parent_object_data);
           }
      }
    else
@@ -1345,19 +1349,20 @@ evas_object_smart_member_stack_below(Evas_Object 
*eo_member, Evas_Object *eo_oth
 }
 
 void
-evas_object_smart_need_bounding_box_update(Evas_Object *eo_obj)
+evas_object_smart_need_bounding_box_update(Evas_Object *eo_obj, 
Evas_Smart_Data *o, Evas_Object_Protected_Data *obj)
 {
    MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
    return;
    MAGIC_CHECK_END();
-   Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, 
EVAS_OBJECT_CLASS);
-   Evas_Smart_Data *o = eo_data_scope_get(eo_obj, MY_CLASS);
 
    evas_object_async_block(obj);
    if (o->update_boundingbox_needed) return;
    o->update_boundingbox_needed = EINA_TRUE;
 
-   if (obj->smart.parent) 
evas_object_smart_need_bounding_box_update(obj->smart.parent);
+   if (obj->smart.parent)
+     evas_object_smart_need_bounding_box_update(obj->smart.parent,
+                                                obj->smart.parent_data,
+                                                obj->smart.parent_object_data);
 }
 
 void
diff --git a/src/lib/evas/include/evas_private.h 
b/src/lib/evas/include/evas_private.h
index b8d5f9c..983e84e 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;
 typedef struct _Evas_Object_3D_Data         Evas_Object_3D_Data;
 typedef struct _Evas_Object_Mask_Data       Evas_Object_Mask_Data;
 
+typedef struct _Evas_Smart_Data             Evas_Smart_Data;
+
 typedef struct _Evas_Object_Protected_State Evas_Object_Protected_State;
 typedef struct _Evas_Object_Protected_Data  Evas_Object_Protected_Data;
 
@@ -1077,6 +1079,8 @@ struct _Evas_Object_Protected_Data
    struct {
       Evas_Smart              *smart;
       Evas_Object             *parent;
+      Evas_Smart_Data         *parent_data;
+      Evas_Object_Protected_Data *parent_object_data;
    } smart;
 
    // 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);
 void _evas_object_smart_members_all_del(Evas_Object *obj);
 void evas_call_smarts_calculate(Evas *e);
 void evas_object_smart_bounding_box_update(Evas_Object *eo_obj, 
Evas_Object_Protected_Data *obj);
-void evas_object_smart_need_bounding_box_update(Evas_Object *obj);
+void evas_object_smart_need_bounding_box_update(Evas_Object *eo_obj, 
Evas_Smart_Data *o, Evas_Object_Protected_Data *obj);
 Eina_Bool evas_object_smart_changed_get(Evas_Object *eo_obj);
 void *evas_mem_calloc(int size);
 void _evas_post_event_callback_call(Evas *e, Evas_Public_Data* e_pd);

-- 


Reply via email to