devilhorns pushed a commit to branch master.

http://git.enlightenment.org/apps/express.git/commit/?id=ab692306f54fe71ea06c8419fbcce3d022ba7b90

commit ab692306f54fe71ea06c8419fbcce3d022ba7b90
Author: Chris Michael <cp.mich...@samsung.com>
Date:   Mon Aug 3 15:30:30 2015 -0400

    express: Reduce calls to evas_object_smart_data_get
    
    Summary: As we have already gotten the smart data from the evas object
    previously, lets modify some functions to take the smart data instead
    of the object so that we can reduce calls to evas_object_smart_data_get.
    
    Signed-off-by: Chris Michael <cp.mich...@samsung.com>
---
 src/bin/media.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/bin/media.c b/src/bin/media.c
index 961aa09..25d7a4d 100644
--- a/src/bin/media.c
+++ b/src/bin/media.c
@@ -61,7 +61,7 @@ _img_cb_preloaded(void *data, Evas *evas EINA_UNUSED, 
Evas_Object *obj EINA_UNUS
 {
    Media *sd;
 
-   if (!(sd = evas_object_smart_data_get(data))) return;
+   if (!(sd = data)) return;
    evas_object_show(sd->o_img);
    evas_object_show(sd->o_clip);
 }
@@ -73,7 +73,7 @@ _img_cb_frame(void *data)
    double t;
    int frame;
 
-   if (!(sd = evas_object_smart_data_get(data))) return EINA_FALSE;
+   if (!(sd = data)) return EINA_FALSE;
    sd->frame++;
    frame = ((sd->frame - 1) % sd->frame_num) + 1;
    if ((sd->frame >= sd->frame_num) && (frame == 1))
@@ -118,7 +118,7 @@ _img_type_anim_handle(Evas_Object *obj)
    sd->frame_num = evas_object_image_animated_frame_count_get(sd->o_img);
    if (sd->frame_num < 2) return;
    t = evas_object_image_animated_frame_duration_get(sd->o_img, sd->frame, 0);
-   sd->anim_tmr = ecore_timer_add(t, _img_cb_frame, obj);
+   sd->anim_tmr = ecore_timer_add(t, _img_cb_frame, sd);
 }
 
 static void 
@@ -133,7 +133,7 @@ _img_type_init(Evas_Object *obj)
    evas_object_clip_set(sd->o_img, sd->o_clip);
    evas_object_raise(sd->o_event);
    evas_object_event_callback_add(sd->o_img, EVAS_CALLBACK_IMAGE_PRELOADED,
-                                  _img_cb_preloaded, obj);
+                                  _img_cb_preloaded, sd);
    evas_object_image_load_orientation_set(sd->o_img, EINA_TRUE);
    evas_object_image_file_set(sd->o_img, sd->realf, NULL);
    evas_object_image_size_get(sd->o_img, &sd->iw, &sd->ih);

-- 


Reply via email to