summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorJunsuChoi <jsuya.choi@samsung.com>2019-11-12 14:28:44 +0900
committerJunsuChoi <jsuya.choi@samsung.com>2019-11-12 14:28:44 +0900
commitddaa5d1e6e76e76cf836182ee392f8b464a243d4 (patch)
tree9cd05a19891af4ad158557b94970798370242f0d /src/modules
parent97f58949720a6dd2b92b71e89179aaffc00e41bc (diff)
vg_loader: Get markers information form json data.
Summary: If json data has marker information, it is stored in vg file data. Test Plan: N/A Reviewers: Hermet, smohanty, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10504
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/evas/vg_loaders/json/evas_vg_load_json.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/modules/evas/vg_loaders/json/evas_vg_load_json.c b/src/modules/evas/vg_loaders/json/evas_vg_load_json.c
index fbcfa9c83a..e7f2754dd9 100644
--- a/src/modules/evas/vg_loaders/json/evas_vg_load_json.c
+++ b/src/modules/evas/vg_loaders/json/evas_vg_load_json.c
@@ -20,6 +20,13 @@ evas_vg_load_file_close_json(Vg_File_Data *vfd)
20 20
21 Lottie_Animation *lot_anim = (Lottie_Animation *) vfd->loader_data; 21 Lottie_Animation *lot_anim = (Lottie_Animation *) vfd->loader_data;
22 lottie_animation_destroy(lot_anim); 22 lottie_animation_destroy(lot_anim);
23 if (vfd->anim_data->markers)
24 {
25 Vg_File_Anim_Data_Marker *marker;
26 EINA_INARRAY_FOREACH(vfd->anim_data->markers, marker)
27 if (marker->name) eina_stringshare_del(marker->name);
28 eina_inarray_free(vfd->anim_data->markers);
29 }
23 if (vfd->anim_data) free(vfd->anim_data); 30 if (vfd->anim_data) free(vfd->anim_data);
24 if (vfd->root) efl_unref(vfd->root); 31 if (vfd->root) efl_unref(vfd->root);
25 free(vfd); 32 free(vfd);
@@ -70,6 +77,23 @@ evas_vg_load_file_open_json(Eina_File *file,
70 if (!vfd->anim_data) goto err; 77 if (!vfd->anim_data) goto err;
71 vfd->anim_data->duration = lottie_animation_get_duration(lot_anim); 78 vfd->anim_data->duration = lottie_animation_get_duration(lot_anim);
72 vfd->anim_data->frame_cnt = frame_cnt; 79 vfd->anim_data->frame_cnt = frame_cnt;
80
81 // marker information
82 const LOTMarkerList *markerlist = lottie_animation_get_markerlist(lot_anim);
83 if (markerlist && markerlist->size > 0)
84 {
85 Vg_File_Anim_Data_Marker *marker;
86 int i = 0;
87 vfd->anim_data->markers = eina_inarray_new(sizeof(Vg_File_Anim_Data_Marker), 0);
88 eina_inarray_resize(vfd->anim_data->markers, markerlist->size);
89 EINA_INARRAY_FOREACH(vfd->anim_data->markers, marker)
90 {
91 marker->name = eina_stringshare_add(markerlist->ptr[i].name);
92 marker->startframe = markerlist->ptr[i].startframe;
93 marker->endframe = markerlist->ptr[i].endframe;
94 i++;
95 }
96 }
73 } 97 }
74 98
75 //default size 99 //default size