hermet pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=fbe554037b4e01909b98b2c3a8aad0775d36df3e

commit fbe554037b4e01909b98b2c3a8aad0775d36df3e
Author: Hermet Park <hermetp...@gmail.com>
Date:   Tue Oct 15 15:03:47 2019 +0900

    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.
---
 src/modules/evas/vg_loaders/json/evas_vg_load_json.c | 16 +++++++++++-----
 1 file 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 11897bb22a..fbcfa9c83a 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,
 
    Lottie_Animation *lot_anim = NULL;
 
-   const char *data = (const char*) eina_file_map_all(file, 
EINA_FILE_SEQUENTIAL);
-   if (!data) goto err;
-   //@TODO pass corrct external_resource path.
-   lot_anim = lottie_animation_from_data(data, key ? 
key:eina_file_filename_get(file), " ");
-   eina_file_map_free(file, (void *) data);
+   //Edje may use virtual memory.
+   if (eina_file_virtual(file))
+     {
+        const char *data = (const char*) eina_file_map_all(file, 
EINA_FILE_SEQUENTIAL);
+        if (!data) goto err;
+        //@TODO pass corrct external_resource path.
+        lot_anim = lottie_animation_from_data(data, key ? 
key:eina_file_filename_get(file), " ");
+        eina_file_map_free(file, (void *) data);
+     }
+   else
+     lot_anim = lottie_animation_from_file(eina_file_filename_get(file));
 
    if (!lot_anim)
      {

-- 


Reply via email to