evas vg: remove mmap internal usage.

This doesn't useful anymore.
This commit is contained in:
Hermet Park 2019-03-11 21:21:40 +09:00
parent 5a1f1c4d5f
commit deb0756e60
7 changed files with 19 additions and 33 deletions

View File

@ -262,8 +262,7 @@ _efl_canvas_vg_object_efl_file_load(Eo *eo_obj, Efl_Canvas_Vg_Object_Data *pd)
old_entry = pd->vg_entry;
pd->vg_entry = evas_cache_vg_entry_create(file, key,
obj->cur->geometry.w,
obj->cur->geometry.h,
EINA_TRUE);
obj->cur->geometry.h);
evas_object_change(eo_obj, obj);
evas_cache_vg_entry_del(old_entry);

View File

@ -26,8 +26,6 @@ typedef struct _Vg_Cache_Entry
Efl_VG *root[3]; //0: default, 1: start frame, 2: end frame
int ref;
Vg_File_Data *vfd;
Eina_Bool mmap : 1;
} Vg_Cache_Entry;
// holds the vg tree info set by the user
@ -122,10 +120,10 @@ struct _Efl_Canvas_Vg_Interpolation
void evas_cache_vg_init(void);
void evas_cache_vg_shutdown(void);
Vg_Cache_Entry* evas_cache_vg_entry_resize(Vg_Cache_Entry *entry, int w, int h);
Vg_Cache_Entry* evas_cache_vg_entry_create(const Eina_File *file, const char *key, int w, int h, Eina_Bool mmap);
Vg_Cache_Entry* evas_cache_vg_entry_create(const Eina_File *file, const char *key, int w, int h);
Efl_VG* evas_cache_vg_tree_get(Vg_Cache_Entry *vg_entry, unsigned int frame_num);
void evas_cache_vg_entry_del(Vg_Cache_Entry *vg_entry);
Vg_File_Data * evas_cache_vg_file_open(const Eina_File *file, const char *key, Eina_Bool mmap);
Vg_File_Data * evas_cache_vg_file_open(const Eina_File *file, const char *key);
Eina_Bool evas_cache_vg_file_save(Efl_VG *root, int w, int h, const char *file, const char *key, const Efl_File_Save_Info *info);
Eina_Bool evas_cache_vg_entry_file_save(Vg_Cache_Entry *vg_entry, const char *file, const char *key, const Efl_File_Save_Info *info);
double evas_cache_vg_anim_duration_get(const Vg_Cache_Entry *vg_entry);

View File

@ -1536,7 +1536,7 @@ struct _Vg_File_Data
struct _Evas_Vg_Load_Func
{
Vg_File_Data *(*file_open) (Eina_File *file, const char *key, Eina_Bool mmap, int *error);
Vg_File_Data *(*file_open) (Eina_File *file, const char *key, int *error);
Eina_Bool (*file_close) (Vg_File_Data *vfd);
Eina_Bool (*file_data) (Vg_File_Data *vfd);
};

View File

@ -70,7 +70,7 @@ _find_loader_module(const char *file)
}
static Vg_File_Data *
_vg_load_from_file(const Eina_File *file, const char *key, Eina_Bool mmap)
_vg_load_from_file(const Eina_File *file, const char *key)
{
Evas_Module *em;
Evas_Vg_Load_Func *loader;
@ -83,7 +83,7 @@ _vg_load_from_file(const Eina_File *file, const char *key, Eina_Bool mmap)
if (em)
{
loader = em->functions;
vfd = loader->file_open((Eina_File *) file, key, mmap, &error);
vfd = loader->file_open((Eina_File *) file, key, &error);
if (vfd)
{
vfd->loader = loader;
@ -98,7 +98,7 @@ _vg_load_from_file(const Eina_File *file, const char *key, Eina_Bool mmap)
if (em)
{
loader = em->functions;
vfd = loader->file_open((Eina_File *) file, key, mmap, &error);
vfd = loader->file_open((Eina_File *) file, key, &error);
if (vfd)
{
vfd->loader = loader;
@ -343,7 +343,7 @@ evas_cache_vg_shutdown(void)
}
Vg_File_Data *
evas_cache_vg_file_open(const Eina_File *file, const char *key, Eina_Bool mmap)
evas_cache_vg_file_open(const Eina_File *file, const char *key)
{
Vg_File_Data *vfd;
Eina_Strbuf *hash_key;
@ -353,7 +353,7 @@ evas_cache_vg_file_open(const Eina_File *file, const char *key, Eina_Bool mmap)
vfd = eina_hash_find(vg_cache->vfd_hash, eina_strbuf_string_get(hash_key));
if (!vfd || vfd->no_share)
{
vfd = _vg_load_from_file(file, key, mmap);
vfd = _vg_load_from_file(file, key);
//File exists.
if (vfd && !vfd->no_share)
eina_hash_add(vg_cache->vfd_hash, eina_strbuf_string_get(hash_key), vfd);
@ -365,14 +365,13 @@ evas_cache_vg_file_open(const Eina_File *file, const char *key, Eina_Bool mmap)
Vg_Cache_Entry*
evas_cache_vg_entry_resize(Vg_Cache_Entry *vg_entry, int w, int h)
{
return evas_cache_vg_entry_create(vg_entry->file, vg_entry->key, w, h, vg_entry->mmap);
return evas_cache_vg_entry_create(vg_entry->file, vg_entry->key, w, h);
}
Vg_Cache_Entry*
evas_cache_vg_entry_create(const Eina_File *file,
const char *key,
int w, int h,
Eina_Bool mmap)
int w, int h)
{
Vg_Cache_Entry* vg_entry;
Eina_Strbuf *hash_key;
@ -398,13 +397,12 @@ evas_cache_vg_entry_create(const Eina_File *file,
vg_entry->w = w;
vg_entry->h = h;
vg_entry->hash_key = eina_strbuf_string_steal(hash_key);
vg_entry->mmap = mmap;
eina_hash_direct_add(vg_cache->vg_entry_hash, vg_entry->hash_key, vg_entry);
}
eina_strbuf_free(hash_key);
vg_entry->ref++;
vg_entry->vfd = evas_cache_vg_file_open(file, key, mmap);
vg_entry->vfd = evas_cache_vg_file_open(file, key);
//No File??
if (!vg_entry->vfd)
{
@ -482,7 +480,7 @@ Eina_Bool
evas_cache_vg_entry_file_save(Vg_Cache_Entry *vg_entry, const char *file, const char *key, const Efl_File_Save_Info *info)
{
Vg_File_Data *vfd =
evas_cache_vg_file_open(vg_entry->file, vg_entry->key, EINA_FALSE);
evas_cache_vg_file_open(vg_entry->file, vg_entry->key);
if (!vfd) return EINA_FALSE;

View File

@ -13,7 +13,7 @@ static int _evas_vg_loader_eet_log_dom = -1;
#define INF(...) EINA_LOG_DOM_INFO(_evas_vg_loader_eet_log_dom, __VA_ARGS__)
static Vg_File_Data*
evas_vg_load_file_open_eet(Eina_File *file, const char *key, Eina_Bool mmap EINA_UNUSED, int *error EINA_UNUSED)
evas_vg_load_file_open_eet(Eina_File *file, const char *key, int *error EINA_UNUSED)
{
Eet_Data_Descriptor *svg_node_eet;
Svg_Node *node;

View File

@ -36,7 +36,6 @@ evas_vg_load_file_data_json(Vg_File_Data *vfd)
static Vg_File_Data*
evas_vg_load_file_open_json(Eina_File *file,
const char *key,
Eina_Bool mmap,
int *error EINA_UNUSED)
{
Vg_File_Data *vfd = calloc(1, sizeof(Vg_File_Data));
@ -44,18 +43,11 @@ evas_vg_load_file_open_json(Eina_File *file,
Lottie_Animation *lot_anim = NULL;
if (mmap)
{
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));
}
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);
if (!lot_anim)
{

View File

@ -2341,7 +2341,6 @@ evas_vg_load_file_close_svg(Vg_File_Data *vfd)
static Vg_File_Data*
evas_vg_load_file_open_svg(Eina_File *file,
const char *key EINA_UNUSED,
Eina_Bool mmap EINA_UNUSED,
int *error EINA_UNUSED)
{
Evas_SVG_Loader loader = {