From: Hermet Park Date: Tue, 15 Oct 2019 06:03:47 +0000 (+0900) Subject: vector json: use lottie apis case by case. X-Git-Tag: submit/tizen/20191111.023126~280 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=82727a8bac989e3aff05b540986f79a586573304;p=platform%2Fupstream%2Fefl.git 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. --- 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, 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) {