summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorShinwoo Kim <cinoo.kim@samsung.com>2020-03-10 09:27:30 -0400
committerMike Blumenkrantz <zmike@samsung.com>2020-03-10 13:31:19 -0400
commita89a2ef1dee61da73cb8d67e8c70450674d02ed5 (patch)
treef8509d7604f4fabc47cec56e8f0f6d0cd8fe8c43 /src/modules
parentd89adaccfbba5733050a8881594f9380eb3bebc5 (diff)
evas.image: add evas_object_image_animated_frame_get
this adds an api for getting the current frame of an animation Differential Revision: https://phab.enlightenment.org/D11455
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/evas/engines/gl_generic/evas_engine.c16
-rw-r--r--src/modules/evas/engines/software_generic/evas_engine.c13
2 files changed, 29 insertions, 0 deletions
diff --git a/src/modules/evas/engines/gl_generic/evas_engine.c b/src/modules/evas/engines/gl_generic/evas_engine.c
index 3f4c36c73b..e73c486073 100644
--- a/src/modules/evas/engines/gl_generic/evas_engine.c
+++ b/src/modules/evas/engines/gl_generic/evas_engine.c
@@ -2158,6 +2158,21 @@ eng_image_animated_frame_set(void *engine EINA_UNUSED, void *image, int frame_in
2158 return EINA_TRUE; 2158 return EINA_TRUE;
2159} 2159}
2160 2160
2161static int
2162eng_image_animated_frame_get(void *engine EINA_UNUSED, void *image)
2163{
2164 Evas_GL_Image *gim = image;
2165 Image_Entry *im;
2166
2167 if (!gim) return EINA_FALSE;
2168 im = (Image_Entry *)gim->im;
2169 if (!im) return EINA_FALSE;
2170
2171 if (!im->animated.animated) return EINA_FALSE;
2172
2173 return im->animated.cur_frame;
2174}
2175
2161static Eina_Bool 2176static Eina_Bool
2162eng_image_can_region_get(void *engine EINA_UNUSED, void *image) 2177eng_image_can_region_get(void *engine EINA_UNUSED, void *image)
2163{ 2178{
@@ -3308,6 +3323,7 @@ module_open(Evas_Module *em)
3308 ORD(image_animated_loop_count_get); 3323 ORD(image_animated_loop_count_get);
3309 ORD(image_animated_frame_duration_get); 3324 ORD(image_animated_frame_duration_get);
3310 ORD(image_animated_frame_set); 3325 ORD(image_animated_frame_set);
3326 ORD(image_animated_frame_get);
3311 3327
3312 ORD(image_max_size_get); 3328 ORD(image_max_size_get);
3313 3329
diff --git a/src/modules/evas/engines/software_generic/evas_engine.c b/src/modules/evas/engines/software_generic/evas_engine.c
index 674e698bc2..a56708fc98 100644
--- a/src/modules/evas/engines/software_generic/evas_engine.c
+++ b/src/modules/evas/engines/software_generic/evas_engine.c
@@ -2915,6 +2915,18 @@ eng_image_animated_frame_set(void *data EINA_UNUSED, void *image, int frame_inde
2915 return EINA_TRUE; 2915 return EINA_TRUE;
2916} 2916}
2917 2917
2918static int
2919eng_image_animated_frame_get(void *data EINA_UNUSED, void *image)
2920{
2921 Image_Entry *im;
2922
2923 if (!image) return EINA_FALSE;
2924 im = image;
2925 if (!im->animated.animated) return EINA_FALSE;
2926
2927 return im->animated.cur_frame;
2928}
2929
2918static void 2930static void
2919_draw_thread_multi_font_draw(void *data) 2931_draw_thread_multi_font_draw(void *data)
2920{ 2932{
@@ -4777,6 +4789,7 @@ static Evas_Func func =
4777 eng_image_animated_loop_count_get, 4789 eng_image_animated_loop_count_get,
4778 eng_image_animated_frame_duration_get, 4790 eng_image_animated_frame_duration_get,
4779 eng_image_animated_frame_set, 4791 eng_image_animated_frame_set,
4792 eng_image_animated_frame_get,
4780 NULL, // image_max_size_get 4793 NULL, // image_max_size_get
4781 eng_multi_font_draw, 4794 eng_multi_font_draw,
4782 eng_pixel_alpha_get, 4795 eng_pixel_alpha_get,