forked from enlightenment/efl
evas/cserve2: Store Image_Data in shared array
Split image entries into Image_Data and Image_Entry. Store, find and use Image_Data descriptors from shared array. Fix some wrong hash table usages.
This commit is contained in:
parent
315c2fd161
commit
64e7d48296
|
@ -288,7 +288,7 @@ void cserve2_cache_client_new(Client *client);
|
||||||
void cserve2_cache_client_del(Client *client);
|
void cserve2_cache_client_del(Client *client);
|
||||||
int cserve2_cache_file_open(Client *client, unsigned int client_file_id, const char *path, const char *key, unsigned int rid);
|
int cserve2_cache_file_open(Client *client, unsigned int client_file_id, const char *path, const char *key, unsigned int rid);
|
||||||
void cserve2_cache_file_close(Client *client, unsigned int client_file_id);
|
void cserve2_cache_file_close(Client *client, unsigned int client_file_id);
|
||||||
int cserve2_cache_image_entry_create(Client *client, int rid, unsigned int file_id, unsigned int image_id, Evas_Image_Load_Opts *opts);
|
int cserve2_cache_image_entry_create(Client *client, int rid, unsigned int client_file_id, unsigned int image_id, Evas_Image_Load_Opts *opts);
|
||||||
void cserve2_rgba_image_scale_do(void *src_data, void *dst_data, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int alpha, int smooth);
|
void cserve2_rgba_image_scale_do(void *src_data, void *dst_data, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int alpha, int smooth);
|
||||||
void cserve2_cache_image_load(Client *client, unsigned int client_image_id, unsigned int rid);
|
void cserve2_cache_image_load(Client *client, unsigned int client_image_id, unsigned int rid);
|
||||||
void cserve2_cache_image_preload(Client *client, unsigned int client_image_id, unsigned int rid);
|
void cserve2_cache_image_preload(Client *client, unsigned int client_image_id, unsigned int rid);
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -759,17 +759,18 @@ cserve2_shared_mempool_buffer_ref(Shared_Mempool *sm, int bufferid)
|
||||||
return ie->id;
|
return ie->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static Eina_Bool
|
||||||
cserve2_shared_mempool_buffer_del(Shared_Mempool *sm, int bufferid)
|
_shared_mempool_buffer_del(Shared_Mempool *sm, int bufferid)
|
||||||
{
|
{
|
||||||
Index_Entry *ie;
|
Index_Entry *ie;
|
||||||
|
|
||||||
if (!sm || !bufferid) return;
|
if (!sm || !bufferid) return EINA_FALSE;
|
||||||
|
|
||||||
ie = _shared_index_entry_find(sm->index, bufferid);
|
ie = _shared_index_entry_find(sm->index, bufferid);
|
||||||
if (!ie || ie->refcount <= 0)
|
if (!ie || ie->refcount <= 0)
|
||||||
{
|
{
|
||||||
CRIT("Tried to delete invalid buffer or with refcount 0");
|
CRIT("Tried to delete invalid buffer or with refcount 0");
|
||||||
return;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
ie->refcount--;
|
ie->refcount--;
|
||||||
|
@ -782,7 +783,16 @@ cserve2_shared_mempool_buffer_del(Shared_Mempool *sm, int bufferid)
|
||||||
sm->empty_blocks = (Block *) eina_rbtree_inline_insert(
|
sm->empty_blocks = (Block *) eina_rbtree_inline_insert(
|
||||||
EINA_RBTREE_GET(sm->empty_blocks), EINA_RBTREE_GET(newblk),
|
EINA_RBTREE_GET(sm->empty_blocks), EINA_RBTREE_GET(newblk),
|
||||||
EINA_RBTREE_CMP_NODE_CB(_block_rbtree_cmp), NULL);
|
EINA_RBTREE_CMP_NODE_CB(_block_rbtree_cmp), NULL);
|
||||||
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return EINA_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
cserve2_shared_mempool_buffer_del(Shared_Mempool *sm, int bufferid)
|
||||||
|
{
|
||||||
|
_shared_mempool_buffer_del(sm, bufferid);
|
||||||
}
|
}
|
||||||
|
|
||||||
void *
|
void *
|
||||||
|
|
Loading…
Reference in New Issue