From 59e9b8d211532f5eaa47c4e42774ddaf46ec0551 Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Fri, 21 Jun 2019 17:32:37 +0900 Subject: [PATCH] evas vector: support lottie animation as using json loader. Summary: This patch extends efl_canvas_vg_object class to implement efl_gfx_frame_controller to suppor any playable animation on it. Plus, vector object takes care of lottie animation by using json loader. it's caching mechanism is changed to cache only static frame, not all frames. vg_cache supports json loader and make it animation request properly. This feature has been stabilized enough, it's using in Samsung Galaxy Watch active product, proved its stability enough. Depends on {D8940} Co-authored-by: JunsuChoi Reviewers: #committers, jsuya Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8941 Change-Id: I7a71bbb3bbf58aa7faed05033e5ede18e7877739 --- src/lib/evas/Evas_Legacy.h | 11 ++++++----- src/lib/evas/canvas/efl_canvas_vg_object.eo | 2 -- src/lib/evas/canvas/evas_vg_private.h | 2 ++ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/lib/evas/Evas_Legacy.h b/src/lib/evas/Evas_Legacy.h index d186c22..09efae9 100755 --- a/src/lib/evas/Evas_Legacy.h +++ b/src/lib/evas/Evas_Legacy.h @@ -3654,7 +3654,8 @@ EAPI Evas_Object *evas_object_vg_add(Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_N * * @return The number of frames. 0, if it's not animated. * - * @since 1.22 + * @since 1.23 +>>>>>>> 625e11f584... evas vector: support lottie animation as using json loader. */ EAPI int evas_object_vg_animated_frame_count_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); @@ -3674,7 +3675,7 @@ EAPI int evas_object_vg_animated_frame_count_get(const Evas_Object *obj) EINA_AR * @return Duration in seconds. * * @see evas_object_vg_animated_frame_count_get() - * @since 1.22 + * @since 1.23 */ EAPI double evas_object_vg_animated_frame_duration_get(const Evas_Object *obj, int start_frame EINA_UNUSED, int frame_num EINA_UNUSED) EINA_ARG_NONNULL(1); @@ -3693,7 +3694,7 @@ NULL, otherwise. * * @return @c EINA_TRUE if it's succeed to read file, @c EINA_FALSE otherwise. * - * @since 1.22 + * @since 1.23 */ EAPI Eina_Bool evas_object_vg_file_set(Evas_Object *obj, const char *file, const char *key); @@ -3708,7 +3709,7 @@ EAPI Eina_Bool evas_object_vg_file_set(Evas_Object *obj, const char *file, const * * @see evas_object_vg_animated_frame_count_get() * - * @since 1.22 + * @since 1.23 */ EAPI Eina_Bool evas_object_vg_animated_frame_set(Evas_Object *obj, int frame_index) EINA_ARG_NONNULL(1, 2); @@ -3720,7 +3721,7 @@ EAPI Eina_Bool evas_object_vg_animated_frame_set(Evas_Object *obj, int frame_ind * @see evas_object_vg_animated_frame_set() * @see evas_object_vg_animated_frame_count_get() * - * @since 1.22 + * @since 1.23 */ EAPI int evas_object_vg_animated_frame_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); diff --git a/src/lib/evas/canvas/efl_canvas_vg_object.eo b/src/lib/evas/canvas/efl_canvas_vg_object.eo index 27741fe..12411ea 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_object.eo +++ b/src/lib/evas/canvas/efl_canvas_vg_object.eo @@ -22,9 +22,7 @@ enum @beta Efl.Canvas.Vg.Fill_Mode } class @beta Efl.Canvas.Vg.Object extends Efl.Canvas.Object implements Efl.File, Efl.File_Save, - //TIZEN_ONLY(20180831): evas json: new feature for lottie - #4 Efl.Gfx.Frame_Controller - // { [[Efl vector graphics class]] methods { diff --git a/src/lib/evas/canvas/evas_vg_private.h b/src/lib/evas/canvas/evas_vg_private.h index e9fba36..5a3e8e5 100644 --- a/src/lib/evas/canvas/evas_vg_private.h +++ b/src/lib/evas/canvas/evas_vg_private.h @@ -48,6 +48,8 @@ struct _Efl_Canvas_Vg_Object_Data Eina_Array cleanup; double align_x, align_y; Efl_Canvas_Vg_Fill_Mode fill_mode; + int frame_idx; + int cached_frame_idx; int frame_idx; int cached_frame_idx; -- 2.7.4