From bfbd9abf9dabd62d4fb85d34ebf032377055b38a Mon Sep 17 00:00:00 2001 From: Jiyoun Park Date: Tue, 18 Oct 2011 09:10:26 +0000 Subject: [PATCH] From: Jiyoun Park Subject: [E-devel] [Patch] modify gl engine's animated function related with cache entry I modified the gl engine code related with animated images This is very trivial. Evas image object passes images to the engine. In the software engine, it is a cache entry , but in the GL engine, it is an Evas_GL Image. So I modified the gl engine code to get the cache entry from the gl image. SVN revision: 64143 --- .../src/modules/engines/gl_x11/evas_engine.c | 42 +++++++++++++------ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/legacy/evas/src/modules/engines/gl_x11/evas_engine.c b/legacy/evas/src/modules/engines/gl_x11/evas_engine.c index 5f0f8dfc75..6c393db225 100644 --- a/legacy/evas/src/modules/engines/gl_x11/evas_engine.c +++ b/legacy/evas/src/modules/engines/gl_x11/evas_engine.c @@ -3688,20 +3688,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; } @@ -3709,10 +3715,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; } @@ -3720,10 +3729,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; } @@ -3731,10 +3743,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); } @@ -3742,10 +3757,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;