evas_vg_cache: Hashkey of cache use value provider list
Summary: Even if the same window, the same file, and the same size, different images may be requested due to property changes caused by value_provider. Test Plan: N/A Reviewers: Hermet, smohanty, kimcinoo Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10303
This commit is contained in:
parent
4867c4bdaf
commit
6b2504ba56
|
@ -290,7 +290,7 @@ _efl_canvas_vg_object_efl_file_load(Eo *eo_obj, Efl_Canvas_Vg_Object_Data *pd)
|
|||
pd->vg_entry = evas_cache_vg_entry_create(evas_object_evas_get(eo_obj),
|
||||
file, key,
|
||||
obj->cur->geometry.w,
|
||||
obj->cur->geometry.h);
|
||||
obj->cur->geometry.h, NULL);
|
||||
evas_object_change(eo_obj, obj);
|
||||
|
||||
return 0;
|
||||
|
@ -569,6 +569,8 @@ _cache_vg_entry_render(Evas_Object_Protected_Data *obj,
|
|||
Eina_Bool drop_cache = EINA_FALSE;
|
||||
void *buffer = NULL;
|
||||
|
||||
evas_cache_vg_entry_value_provider_update(pd->vg_entry, efl_key_data_get(obj->object, "_vg_value_providers"));
|
||||
|
||||
// if the size changed in between path set and the draw call;
|
||||
if ((vg_entry->w != w) ||
|
||||
(vg_entry->h != h))
|
||||
|
@ -616,8 +618,6 @@ _cache_vg_entry_render(Evas_Object_Protected_Data *obj,
|
|||
h = size.h;
|
||||
|
||||
}
|
||||
if (pd->vg_entry->vfd)
|
||||
pd->vg_entry->vfd->vp_list = efl_key_data_get(obj->object, "_vg_value_providers");
|
||||
root = evas_cache_vg_tree_get(vg_entry, pd->frame_idx);
|
||||
if (!root) return;
|
||||
|
||||
|
|
|
@ -143,8 +143,9 @@ Efl_Gfx_Vg_Value_Provider_Change_Flag efl_gfx_vg_value_provider_changed_flag_get
|
|||
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(Evas *evas, const Eina_File *file, const char *key, int w, int h);
|
||||
Vg_Cache_Entry* evas_cache_vg_entry_create(Evas *evas, const Eina_File *file, const char *key, int w, int h, Eina_List *vp_list);
|
||||
Efl_VG* evas_cache_vg_tree_get(Vg_Cache_Entry *vg_entry, unsigned int frame_num);
|
||||
void evas_cache_vg_entry_value_provider_update(Vg_Cache_Entry *vg_entry, Eina_List *vp_list);
|
||||
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 evas_cache_vg_file_save(Efl_VG *root, int w, int h, const char *file, const char *key, const Efl_File_Save_Info *info);
|
||||
|
|
|
@ -365,14 +365,14 @@ evas_cache_vg_file_open(const Eina_File *file, const char *key)
|
|||
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->evas, vg_entry->file, vg_entry->key, w, h);
|
||||
return evas_cache_vg_entry_create(vg_entry->evas, vg_entry->file, vg_entry->key, w, h, vg_entry->vfd->vp_list);
|
||||
}
|
||||
|
||||
Vg_Cache_Entry*
|
||||
evas_cache_vg_entry_create(Evas *evas,
|
||||
const Eina_File *file,
|
||||
const char *key,
|
||||
int w, int h)
|
||||
int w, int h, Eina_List *vp_list)
|
||||
{
|
||||
Vg_Cache_Entry* vg_entry;
|
||||
Eina_Strbuf *hash_key;
|
||||
|
@ -380,9 +380,9 @@ evas_cache_vg_entry_create(Evas *evas,
|
|||
if (!vg_cache) return NULL;
|
||||
|
||||
//TODO: zero-sized entry is useless. how to skip it?
|
||||
|
||||
//
|
||||
hash_key = eina_strbuf_new();
|
||||
eina_strbuf_append_printf(hash_key, "%p/%p/%s/%d/%d", evas, file, key, w, h);
|
||||
eina_strbuf_append_printf(hash_key, "%p/%p/%s/%d/%d/%p", evas, file, key, w, h, vp_list);
|
||||
vg_entry = eina_hash_find(vg_cache->vg_entry_hash, eina_strbuf_string_get(hash_key));
|
||||
if (!vg_entry)
|
||||
{
|
||||
|
@ -412,6 +412,7 @@ evas_cache_vg_entry_create(Evas *evas,
|
|||
return NULL;
|
||||
}
|
||||
vg_entry->vfd->ref++;
|
||||
vg_entry->vfd->vp_list = vp_list;
|
||||
|
||||
return vg_entry;
|
||||
}
|
||||
|
@ -461,6 +462,17 @@ evas_cache_vg_tree_get(Vg_Cache_Entry *vg_entry, unsigned int frame_num)
|
|||
return vg_entry->root[0];
|
||||
}
|
||||
|
||||
void
|
||||
evas_cache_vg_entry_value_provider_update(Vg_Cache_Entry *vg_entry, Eina_List *vp_list)
|
||||
{
|
||||
if (!vg_entry) return;
|
||||
|
||||
Vg_File_Data *vfd = vg_entry->vfd;
|
||||
if (!vfd) return;
|
||||
|
||||
vfd->vp_list = vp_list;
|
||||
}
|
||||
|
||||
void
|
||||
evas_cache_vg_entry_del(Vg_Cache_Entry *vg_entry)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue