summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHermet Park <hermetpark@gmail.com>2019-10-15 15:03:47 +0900
committerHermet Park <hermetpark@gmail.com>2019-10-15 15:06:48 +0900
commitfbe554037b4e01909b98b2c3a8aad0775d36df3e (patch)
treeed4df43b2b1d247f90acffea4f8568931fa50c1a /src
parent74e2c80b6e3d3d4ee25792140cdbc4a95ef08f3b (diff)
vector json: use lottie apis case by case.
We can request loading from data only in case of actual memory map. The lottie-player would take care of the parsing on utf8/16/32 formats more precisely so that we don't need to take care of this converting from the memory.
Diffstat (limited to 'src')
-rw-r--r--src/modules/evas/vg_loaders/json/evas_vg_load_json.c16
1 files changed, 11 insertions, 5 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 11897bb..fbcfa9c 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
@@ -43,11 +43,17 @@ evas_vg_load_file_open_json(Eina_File *file,
43 43
44 Lottie_Animation *lot_anim = NULL; 44 Lottie_Animation *lot_anim = NULL;
45 45
46 const char *data = (const char*) eina_file_map_all(file, EINA_FILE_SEQUENTIAL); 46 //Edje may use virtual memory.
47 if (!data) goto err; 47 if (eina_file_virtual(file))
48 //@TODO pass corrct external_resource path. 48 {
49 lot_anim = lottie_animation_from_data(data, key ? key:eina_file_filename_get(file), " "); 49 const char *data = (const char*) eina_file_map_all(file, EINA_FILE_SEQUENTIAL);
50 eina_file_map_free(file, (void *) data); 50 if (!data) goto err;
51 //@TODO pass corrct external_resource path.
52 lot_anim = lottie_animation_from_data(data, key ? key:eina_file_filename_get(file), " ");
53 eina_file_map_free(file, (void *) data);
54 }
55 else
56 lot_anim = lottie_animation_from_file(eina_file_filename_get(file));
51 57
52 if (!lot_anim) 58 if (!lot_anim)
53 { 59 {