evas vector: support lottie animation as using json loader. 05/208305/1
authorHermet Park <hermetpark@gmail.com>
Fri, 21 Jun 2019 08:32:37 +0000 (17:32 +0900)
committerHermet Park <hermetpark@gmail.com>
Fri, 21 Jun 2019 09:00:51 +0000 (18:00 +0900)
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 <jsuya.choi@samsung.com>
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
src/lib/evas/canvas/efl_canvas_vg_object.eo
src/lib/evas/canvas/evas_vg_private.h

index d186c22..09efae9 100755 (executable)
@@ -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);
 
index 27741fe..12411ea 100644 (file)
@@ -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 {
index e9fba36..5a3e8e5 100644 (file)
@@ -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;