[*] fix the gl engine's animated code.
authorJiyoun Park <jy0703.park@samsung.com>
Tue, 18 Oct 2011 09:20:35 +0000 (18:20 +0900)
committerJiyoun Park <jy0703.park@samsung.com>
Tue, 18 Oct 2011 09:20:35 +0000 (18:20 +0900)
it change image to the cache entry but image is not a cache entry.
it is a Gl image.

Change-Id: I04d5022562dbef02567c55687f34ff994d612980

src/modules/engines/gl_x11/evas_engine.c

index 58a131e..88a283f 100644 (file)
@@ -2999,20 +2999,26 @@ eng_image_load_error_get(void *data __UNUSED__, void *image)
 static Eina_Bool
 eng_image_animated_get(void *data __UNUSED__, void *image)
 {
+   Evas_GL_Image *gim = image;
    Image_Entry *im;
 
-   if (!image) return EINA_FALSE;
-   im = image;
+   if (!gim) return EINA_FALSE;
+   im = (Image_Entry *)gim->im;
+   if (!im) return EINA_FALSE;
+
    return im->flags.animated;
 }
 
 static int
 eng_image_animated_frame_count_get(void *data __UNUSED__, void *image)
 {
+   Evas_GL_Image *gim = image;
    Image_Entry *im;
 
-   if (!image) return -1;
-   im = image;
+   if (!gim) return -1;
+   im = (Image_Entry *)gim->im;
+   if (!im) return -1;
+
    if (!im->flags.animated) return -1;
    return im->frame_count;
 }
@@ -3020,10 +3026,13 @@ eng_image_animated_frame_count_get(void *data __UNUSED__, void *image)
 static Evas_Image_Animated_Loop_Hint
 eng_image_animated_loop_type_get(void *data __UNUSED__, void *image)
 {
+   Evas_GL_Image *gim = image;
    Image_Entry *im;
 
-   if (!image) return EVAS_IMAGE_ANIMATED_HINT_NONE;
-   im = image;
+   if (!gim) return EVAS_IMAGE_ANIMATED_HINT_NONE;
+   im = (Image_Entry *)gim->im;
+   if (!im) return EVAS_IMAGE_ANIMATED_HINT_NONE;
+
    if (!im->flags.animated) return EVAS_IMAGE_ANIMATED_HINT_NONE;
    return im->loop_hint;
 }
@@ -3031,10 +3040,13 @@ eng_image_animated_loop_type_get(void *data __UNUSED__, void *image)
 static int
 eng_image_animated_loop_count_get(void *data __UNUSED__, void *image)
 {
+   Evas_GL_Image *gim = image;
    Image_Entry *im;
 
-   if (!image) return -1;
-   im = image;
+   if (!gim) return -1;
+   im = (Image_Entry *)gim->im;
+   if (!im) return -1;
+
    if (!im->flags.animated) return -1;
    return im->loop_count;
 }
@@ -3042,10 +3054,13 @@ eng_image_animated_loop_count_get(void *data __UNUSED__, void *image)
 static double
 eng_image_animated_frame_duration_get(void *data __UNUSED__, void *image, int start_frame, int frame_num)
 {
+   Evas_GL_Image *gim = image;
    Image_Entry *im;
 
-   if (!image) return -1;
-   im = image;
+   if (!gim) return -1;
+   im = (Image_Entry *)gim->im;
+   if (!im) return -1;
+
    if (!im->flags.animated) return -1;
    return evas_common_load_rgba_image_frame_duration_from_file(im, start_frame, frame_num);
 }
@@ -3053,10 +3068,13 @@ eng_image_animated_frame_duration_get(void *data __UNUSED__, void *image, int st
 static Eina_Bool
 eng_image_animated_frame_set(void *data __UNUSED__, void *image, int frame_index)
 {
+   Evas_GL_Image *gim = image;
    Image_Entry *im;
 
-   if (!image) return EINA_FALSE;
-   im = image;
+   if (!gim) return EINA_FALSE;
+   im = (Image_Entry *)gim->im;
+   if (!im) return EINA_FALSE;
+
    if (!im->flags.animated) return EINA_FALSE;
    if (im->cur_frame == frame_index) return EINA_FALSE;