summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunsuChoi <jsuya.choi@samsung.com>2020-02-18 09:56:15 +0900
committerJunsuChoi <jsuya.choi@samsung.com>2020-02-18 09:56:15 +0900
commit2b252c45844a256777464352b63115643e5c0387 (patch)
tree584d73e4ab0abb05a4ae217234d6f01cfbb6b1a4
parent4f0bb0a4e71c812f7c5024daf291a43260d4f29a (diff)
If cached file have a vp_list it should disable file caching.
-rw-r--r--src/lib/evas/canvas/efl_canvas_vg_object.c8
-rw-r--r--src/lib/evas/canvas/evas_vg_private.h4
-rw-r--r--src/lib/evas/vg/evas_vg_cache.c21
3 files changed, 17 insertions, 16 deletions
diff --git a/src/lib/evas/canvas/efl_canvas_vg_object.c b/src/lib/evas/canvas/efl_canvas_vg_object.c
index cccd9e2c6b..d288dee06b 100644
--- a/src/lib/evas/canvas/efl_canvas_vg_object.c
+++ b/src/lib/evas/canvas/efl_canvas_vg_object.c
@@ -586,12 +586,12 @@ _cache_vg_entry_render(Evas_Object_Protected_Data *obj,
586 Eina_Position2D offset = {0, 0}; //Offset after keeping aspect ratio. 586 Eina_Position2D offset = {0, 0}; //Offset after keeping aspect ratio.
587 void *buffer = NULL; 587 void *buffer = NULL;
588 void *key = NULL; 588 void *key = NULL;
589 589Eina_List *vp_list = efl_key_data_get(obj->object, "_vg_value_providers");
590 evas_cache_vg_entry_value_provider_update(pd->vg_entry, efl_key_data_get(obj->object, "_vg_value_providers")); 590 Eina_Bool vp_updated = evas_cache_vg_entry_value_provider_update(pd->vg_entry, vp_list);
591 591
592 // if the size changed in between path set and the draw call; 592 // if the size changed in between path set and the draw call;
593 if ((vg_entry->w != w) || 593 if ((vg_entry->w != w) ||
594 (vg_entry->h != h)) 594 (vg_entry->h != h) || vp_updated)
595 { 595 {
596 Eina_Size2D size = evas_cache_vg_entry_default_size_get(pd->vg_entry); 596 Eina_Size2D size = evas_cache_vg_entry_default_size_get(pd->vg_entry);
597 597
@@ -619,7 +619,7 @@ _cache_vg_entry_render(Evas_Object_Protected_Data *obj,
619 } 619 }
620 620
621 //Size is changed, cached data is invalid. 621 //Size is changed, cached data is invalid.
622 if ((size.w != vg_entry->w) || (size.h != vg_entry->h)) 622 if ((size.w != vg_entry->w) || (size.h != vg_entry->h) || vp_updated)
623 { 623 {
624//Not necessary, but this might be helpful for precise caching. 624//Not necessary, but this might be helpful for precise caching.
625#if 0 625#if 0
diff --git a/src/lib/evas/canvas/evas_vg_private.h b/src/lib/evas/canvas/evas_vg_private.h
index a6a27142ed..ca02810ffb 100644
--- a/src/lib/evas/canvas/evas_vg_private.h
+++ b/src/lib/evas/canvas/evas_vg_private.h
@@ -145,9 +145,9 @@ void evas_cache_vg_shutdown(void);
145Vg_Cache_Entry* evas_cache_vg_entry_resize(Vg_Cache_Entry *entry, int w, int h); 145Vg_Cache_Entry* evas_cache_vg_entry_resize(Vg_Cache_Entry *entry, int w, int h);
146Vg_Cache_Entry* evas_cache_vg_entry_create(Evas *evas, const Eina_File *file, const char *key, int w, int h, Eina_List *vp_list); 146Vg_Cache_Entry* evas_cache_vg_entry_create(Evas *evas, const Eina_File *file, const char *key, int w, int h, Eina_List *vp_list);
147Efl_VG* evas_cache_vg_tree_get(Vg_Cache_Entry *vg_entry, unsigned int frame_num); 147Efl_VG* evas_cache_vg_tree_get(Vg_Cache_Entry *vg_entry, unsigned int frame_num);
148void evas_cache_vg_entry_value_provider_update(Vg_Cache_Entry *vg_entry, Eina_List *vp_list); 148Eina_Bool evas_cache_vg_entry_value_provider_update(Vg_Cache_Entry *vg_entry, Eina_List *vp_list);
149void evas_cache_vg_entry_del(Vg_Cache_Entry *vg_entry); 149void evas_cache_vg_entry_del(Vg_Cache_Entry *vg_entry);
150Vg_File_Data * evas_cache_vg_file_open(const Eina_File *file, const char *key, Evas *e); 150Vg_File_Data * evas_cache_vg_file_open(const Eina_File *file, const char *key, Evas *e, Eina_List* vp_list);
151Eina_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); 151Eina_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);
152Eina_Bool evas_cache_vg_entry_file_save(Vg_Cache_Entry *vg_entry, const char *file, const char *key, const Efl_File_Save_Info *info); 152Eina_Bool evas_cache_vg_entry_file_save(Vg_Cache_Entry *vg_entry, const char *file, const char *key, const Efl_File_Save_Info *info);
153double evas_cache_vg_anim_duration_get(const Vg_Cache_Entry *vg_entry); 153double evas_cache_vg_anim_duration_get(const Vg_Cache_Entry *vg_entry);
diff --git a/src/lib/evas/vg/evas_vg_cache.c b/src/lib/evas/vg/evas_vg_cache.c
index e9990107ee..801375f9e6 100644
--- a/src/lib/evas/vg/evas_vg_cache.c
+++ b/src/lib/evas/vg/evas_vg_cache.c
@@ -154,10 +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/%p", 157 eina_strbuf_append_printf(hash_key, "%s/%s/%p/%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 vg_entry->evas, vg_entry->vfd->vp_list);
161 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))
162 ERR("Failed to delete vfd = (%p) from hash", vg_entry->vfd); 162 ERR("Failed to delete vfd = (%p) from hash", vg_entry->vfd);
163 eina_strbuf_free(hash_key); 163 eina_strbuf_free(hash_key);
@@ -214,6 +214,7 @@ _root_update(Vg_Cache_Entry *vg_entry)
214 //Shareable?? 214 //Shareable??
215 else if (vg_entry->root != vfd->root) 215 else if (vg_entry->root != vfd->root)
216 { 216 {
217printf("vg_entry->root :%p\n",vg_entry->root);
217 if (vg_entry->root) efl_unref(vg_entry->root); 218 if (vg_entry->root) efl_unref(vg_entry->root);
218 vg_entry->root = efl_ref(vfd->root); 219 vg_entry->root = efl_ref(vfd->root);
219 } 220 }
@@ -322,13 +323,13 @@ evas_cache_vg_shutdown(void)
322} 323}
323 324
324Vg_File_Data * 325Vg_File_Data *
325evas_cache_vg_file_open(const Eina_File *file, const char *key, Evas *e) 326evas_cache_vg_file_open(const Eina_File *file, const char *key, Evas *e, Eina_List* vp_list)
326{ 327{
327 Vg_File_Data *vfd; 328 Vg_File_Data *vfd;
328 Eina_Strbuf *hash_key; 329 Eina_Strbuf *hash_key;
329 330
330 hash_key = eina_strbuf_new(); 331 hash_key = eina_strbuf_new();
331 eina_strbuf_append_printf(hash_key, "%s/%s/%p", eina_file_filename_get(file), key, e); 332 eina_strbuf_append_printf(hash_key, "%s/%s/%p/%p", eina_file_filename_get(file), key, e, vp_list);
332 vfd = eina_hash_find(vg_cache->vfd_hash, eina_strbuf_string_get(hash_key)); 333 vfd = eina_hash_find(vg_cache->vfd_hash, eina_strbuf_string_get(hash_key));
333 if (!vfd) 334 if (!vfd)
334 { 335 {
@@ -356,7 +357,6 @@ evas_cache_vg_entry_create(Evas *evas,
356 Eina_Strbuf *hash_key; 357 Eina_Strbuf *hash_key;
357 358
358 if (!vg_cache) return NULL; 359 if (!vg_cache) return NULL;
359
360 //TODO: zero-sized entry is useless. how to skip it? 360 //TODO: zero-sized entry is useless. how to skip it?
361 hash_key = eina_strbuf_new(); 361 hash_key = eina_strbuf_new();
362 eina_strbuf_append_printf(hash_key, "%p/%p/%s/%d/%d/%p", evas, file, key, w, h, vp_list); 362 eina_strbuf_append_printf(hash_key, "%p/%p/%s/%d/%d/%p", evas, file, key, w, h, vp_list);
@@ -380,7 +380,7 @@ evas_cache_vg_entry_create(Evas *evas,
380 } 380 }
381 eina_strbuf_free(hash_key); 381 eina_strbuf_free(hash_key);
382 vg_entry->ref++; 382 vg_entry->ref++;
383 vg_entry->vfd = evas_cache_vg_file_open(file, key, vg_entry->evas); 383 vg_entry->vfd = evas_cache_vg_file_open(file, key, vg_entry->evas, vp_list);
384 //No File?? 384 //No File??
385 if (!vg_entry->vfd) 385 if (!vg_entry->vfd)
386 { 386 {
@@ -504,15 +504,16 @@ evas_cache_vg_tree_get(Vg_Cache_Entry *vg_entry, unsigned int frame_num)
504 return vg_entry->root; 504 return vg_entry->root;
505} 505}
506 506
507void 507Eina_Bool
508evas_cache_vg_entry_value_provider_update(Vg_Cache_Entry *vg_entry, Eina_List *vp_list) 508evas_cache_vg_entry_value_provider_update(Vg_Cache_Entry *vg_entry, Eina_List *vp_list)
509{ 509{
510 if (!vg_entry) return; 510 if (!vg_entry) return EINA_FALSE;
511 511
512 Vg_File_Data *vfd = vg_entry->vfd; 512 Vg_File_Data *vfd = vg_entry->vfd;
513 if (!vfd) return; 513 if (!vfd) return EINA_FALSE;
514 514
515 vfd->vp_list = vp_list; 515 vfd->vp_list = vp_list;
516 return EINA_TRUE;
516} 517}
517 518
518void 519void
@@ -536,7 +537,7 @@ Eina_Bool
536evas_cache_vg_entry_file_save(Vg_Cache_Entry *vg_entry, const char *file, const char *key, const Efl_File_Save_Info *info) 537evas_cache_vg_entry_file_save(Vg_Cache_Entry *vg_entry, const char *file, const char *key, const Efl_File_Save_Info *info)
537{ 538{
538 Vg_File_Data *vfd = 539 Vg_File_Data *vfd =
539 evas_cache_vg_file_open(vg_entry->file, vg_entry->key, vg_entry->evas); 540 evas_cache_vg_file_open(vg_entry->file, vg_entry->key, vg_entry->evas, NULL);
540 541
541 if (!vfd) return EINA_FALSE; 542 if (!vfd) return EINA_FALSE;
542 543