summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunsuChoi <jsuya.choi@samsung.com>2019-09-10 20:06:18 +0900
committerJunsuChoi <jsuya.choi@samsung.com>2019-09-10 20:06:18 +0900
commit6d465b0b1ffec1cf0f87243143c5a1a5b441b496 (patch)
treecb04e94158db0bbd26ab0d6e6a593df35938e9b9
parentf78b4861af140bd5b333fb530556e81915acbaab (diff)
evas_vg_cache: Hashkey in cache uses evas
Summary: Vg_entry is shared by different child windows. When two or more objects load the same file When resizing, cache_vg_entry_render can delete an active entry while creating a new entry and deleting an existing entry. Therefore, use cache data added evas Test Plan: [enable json loader] --- a/meson_options.txt +++ b/meson_options.txt @@ -203,7 +203,7 @@ option('evas-loaders-disabler', type : 'array', description : 'List of modular image/vector load ..... choices : ['gst', 'pdf', 'ps', 'raw', 'svg', 'rs ..... - value : ['webp', 'json'] + value : ['webp'] [Test] elementary_test -> Animation View click -> play -> Animation View click again -> ... Reviewers: Hermet, smohanty, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9740
-rw-r--r--src/lib/evas/canvas/efl_canvas_vg_object.c3
-rw-r--r--src/lib/evas/canvas/evas_vg_private.h3
-rw-r--r--src/lib/evas/vg/evas_vg_cache.c8
3 files changed, 9 insertions, 5 deletions
diff --git a/src/lib/evas/canvas/efl_canvas_vg_object.c b/src/lib/evas/canvas/efl_canvas_vg_object.c
index 1617bc1025..6fc21e1de7 100644
--- a/src/lib/evas/canvas/efl_canvas_vg_object.c
+++ b/src/lib/evas/canvas/efl_canvas_vg_object.c
@@ -289,7 +289,8 @@ _efl_canvas_vg_object_efl_file_load(Eo *eo_obj, Efl_Canvas_Vg_Object_Data *pd)
289 Evas_Object_Protected_Data *obj; 289 Evas_Object_Protected_Data *obj;
290 290
291 obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); 291 obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
292 pd->vg_entry = evas_cache_vg_entry_create(file, key, 292 pd->vg_entry = evas_cache_vg_entry_create(evas_object_evas_get(eo_obj),
293 file, key,
293 obj->cur->geometry.w, 294 obj->cur->geometry.w,
294 obj->cur->geometry.h); 295 obj->cur->geometry.h);
295 evas_object_change(eo_obj, obj); 296 evas_object_change(eo_obj, obj);
diff --git a/src/lib/evas/canvas/evas_vg_private.h b/src/lib/evas/canvas/evas_vg_private.h
index d8a07b24f1..c3752b003b 100644
--- a/src/lib/evas/canvas/evas_vg_private.h
+++ b/src/lib/evas/canvas/evas_vg_private.h
@@ -18,6 +18,7 @@ typedef struct _Vg_Cache
18 18
19typedef struct _Vg_Cache_Entry 19typedef struct _Vg_Cache_Entry
20{ 20{
21 Evas *evas;
21 char *hash_key; 22 char *hash_key;
22 const Eina_File *file; 23 const Eina_File *file;
23 Eina_Stringshare *key; 24 Eina_Stringshare *key;
@@ -124,7 +125,7 @@ struct _Efl_Canvas_Vg_Interpolation
124void evas_cache_vg_init(void); 125void evas_cache_vg_init(void);
125void evas_cache_vg_shutdown(void); 126void evas_cache_vg_shutdown(void);
126Vg_Cache_Entry* evas_cache_vg_entry_resize(Vg_Cache_Entry *entry, int w, int h); 127Vg_Cache_Entry* evas_cache_vg_entry_resize(Vg_Cache_Entry *entry, int w, int h);
127Vg_Cache_Entry* evas_cache_vg_entry_create(const Eina_File *file, const char *key, int w, int h); 128Vg_Cache_Entry* evas_cache_vg_entry_create(Evas *evas, const Eina_File *file, const char *key, int w, int h);
128Efl_VG* evas_cache_vg_tree_get(Vg_Cache_Entry *vg_entry, unsigned int frame_num); 129Efl_VG* evas_cache_vg_tree_get(Vg_Cache_Entry *vg_entry, unsigned int frame_num);
129void evas_cache_vg_entry_del(Vg_Cache_Entry *vg_entry); 130void evas_cache_vg_entry_del(Vg_Cache_Entry *vg_entry);
130Vg_File_Data * evas_cache_vg_file_open(const Eina_File *file, const char *key); 131Vg_File_Data * evas_cache_vg_file_open(const Eina_File *file, const char *key);
diff --git a/src/lib/evas/vg/evas_vg_cache.c b/src/lib/evas/vg/evas_vg_cache.c
index dd85349ee9..f6a1c1cab2 100644
--- a/src/lib/evas/vg/evas_vg_cache.c
+++ b/src/lib/evas/vg/evas_vg_cache.c
@@ -365,11 +365,12 @@ evas_cache_vg_file_open(const Eina_File *file, const char *key)
365Vg_Cache_Entry* 365Vg_Cache_Entry*
366evas_cache_vg_entry_resize(Vg_Cache_Entry *vg_entry, int w, int h) 366evas_cache_vg_entry_resize(Vg_Cache_Entry *vg_entry, int w, int h)
367{ 367{
368 return evas_cache_vg_entry_create(vg_entry->file, vg_entry->key, w, h); 368 return evas_cache_vg_entry_create(vg_entry->evas, vg_entry->file, vg_entry->key, w, h);
369} 369}
370 370
371Vg_Cache_Entry* 371Vg_Cache_Entry*
372evas_cache_vg_entry_create(const Eina_File *file, 372evas_cache_vg_entry_create(Evas *evas,
373 const Eina_File *file,
373 const char *key, 374 const char *key,
374 int w, int h) 375 int w, int h)
375{ 376{
@@ -381,7 +382,7 @@ evas_cache_vg_entry_create(const Eina_File *file,
381 //TODO: zero-sized entry is useless. how to skip it? 382 //TODO: zero-sized entry is useless. how to skip it?
382 383
383 hash_key = eina_strbuf_new(); 384 hash_key = eina_strbuf_new();
384 eina_strbuf_append_printf(hash_key, "%p/%s/%d/%d", file, key, w, h); 385 eina_strbuf_append_printf(hash_key, "%p/%p/%s/%d/%d", evas, file, key, w, h);
385 vg_entry = eina_hash_find(vg_cache->vg_entry_hash, eina_strbuf_string_get(hash_key)); 386 vg_entry = eina_hash_find(vg_cache->vg_entry_hash, eina_strbuf_string_get(hash_key));
386 if (!vg_entry) 387 if (!vg_entry)
387 { 388 {
@@ -396,6 +397,7 @@ evas_cache_vg_entry_create(const Eina_File *file,
396 vg_entry->key = eina_stringshare_add(key); 397 vg_entry->key = eina_stringshare_add(key);
397 vg_entry->w = w; 398 vg_entry->w = w;
398 vg_entry->h = h; 399 vg_entry->h = h;
400 vg_entry->evas = evas;
399 vg_entry->hash_key = eina_strbuf_string_steal(hash_key); 401 vg_entry->hash_key = eina_strbuf_string_steal(hash_key);
400 eina_hash_direct_add(vg_cache->vg_entry_hash, vg_entry->hash_key, vg_entry); 402 eina_hash_direct_add(vg_cache->vg_entry_hash, vg_entry->hash_key, vg_entry);
401 } 403 }