summaryrefslogtreecommitdiff
path: root/src/lib/evas/vg/evas_vg_cache.c
diff options
context:
space:
mode:
authorHermet Park <hermetpark@gmail.com>2019-11-29 10:48:59 +0900
committerHermet Park <hermetpark@gmail.com>2019-11-29 10:51:19 +0900
commit153b5cffd80748aa913a3fa7da0337167496ad10 (patch)
tree89852f0c97ebf166ef1402fb5218f78a80c3fd50 /src/lib/evas/vg/evas_vg_cache.c
parent7c79ca674d7583b19a0c03e3763c69c943056884 (diff)
evas vector: operate cached vector file data per evas instances.
each vfd loaders construct vector tree data, these can be belongs to evas instance, they are not likely shareable. We should operate vfd separately.
Diffstat (limited to 'src/lib/evas/vg/evas_vg_cache.c')
-rw-r--r--src/lib/evas/vg/evas_vg_cache.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/lib/evas/vg/evas_vg_cache.c b/src/lib/evas/vg/evas_vg_cache.c
index 54925bd82d..ed65f50099 100644
--- a/src/lib/evas/vg/evas_vg_cache.c
+++ b/src/lib/evas/vg/evas_vg_cache.c
@@ -154,9 +154,10 @@ _evas_cache_vg_entry_free_cb(void *data)
154 if (vg_entry->vfd->ref <= 0) 154 if (vg_entry->vfd->ref <= 0)
155 { 155 {
156 Eina_Strbuf *hash_key = eina_strbuf_new(); 156 Eina_Strbuf *hash_key = eina_strbuf_new();
157 eina_strbuf_append_printf(hash_key, "%s/%s", 157 eina_strbuf_append_printf(hash_key, "%s/%s/%p",
158 eina_file_filename_get(vg_entry->file), 158 eina_file_filename_get(vg_entry->file),
159 vg_entry->key); 159 vg_entry->key,
160 vg_entry->evas);
160 if (!eina_hash_del(vg_cache->vfd_hash, eina_strbuf_string_get(hash_key), vg_entry->vfd)) 161 if (!eina_hash_del(vg_cache->vfd_hash, eina_strbuf_string_get(hash_key), vg_entry->vfd))
161 ERR("Failed to delete vfd = (%p) from hash", vg_entry->vfd); 162 ERR("Failed to delete vfd = (%p) from hash", vg_entry->vfd);
162 eina_strbuf_free(hash_key); 163 eina_strbuf_free(hash_key);
@@ -281,13 +282,13 @@ evas_cache_vg_shutdown(void)
281} 282}
282 283
283Vg_File_Data * 284Vg_File_Data *
284evas_cache_vg_file_open(const Eina_File *file, const char *key) 285evas_cache_vg_file_open(const Eina_File *file, const char *key, Evas *e)
285{ 286{
286 Vg_File_Data *vfd; 287 Vg_File_Data *vfd;
287 Eina_Strbuf *hash_key; 288 Eina_Strbuf *hash_key;
288 289
289 hash_key = eina_strbuf_new(); 290 hash_key = eina_strbuf_new();
290 eina_strbuf_append_printf(hash_key, "%s/%s", eina_file_filename_get(file), key); 291 eina_strbuf_append_printf(hash_key, "%s/%s/%p", eina_file_filename_get(file), key, e);
291 vfd = eina_hash_find(vg_cache->vfd_hash, eina_strbuf_string_get(hash_key)); 292 vfd = eina_hash_find(vg_cache->vfd_hash, eina_strbuf_string_get(hash_key));
292 if (!vfd) 293 if (!vfd)
293 { 294 {
@@ -340,7 +341,7 @@ evas_cache_vg_entry_create(Evas *evas,
340 eina_strbuf_free(hash_key); 341 eina_strbuf_free(hash_key);
341 vg_entry->ref++; 342 vg_entry->ref++;
342 343
343 vg_entry->vfd = evas_cache_vg_file_open(file, key); 344 vg_entry->vfd = evas_cache_vg_file_open(file, key, vg_entry->evas);
344 //No File?? 345 //No File??
345 if (!vg_entry->vfd) 346 if (!vg_entry->vfd)
346 { 347 {
@@ -483,7 +484,7 @@ Eina_Bool
483evas_cache_vg_entry_file_save(Vg_Cache_Entry *vg_entry, const char *file, const char *key, const Efl_File_Save_Info *info) 484evas_cache_vg_entry_file_save(Vg_Cache_Entry *vg_entry, const char *file, const char *key, const Efl_File_Save_Info *info)
484{ 485{
485 Vg_File_Data *vfd = 486 Vg_File_Data *vfd =
486 evas_cache_vg_file_open(vg_entry->file, vg_entry->key); 487 evas_cache_vg_file_open(vg_entry->file, vg_entry->key, vg_entry->evas);
487 488
488 if (!vfd) return EINA_FALSE; 489 if (!vfd) return EINA_FALSE;
489 490