efl/cserve2: Fix ref/unef of image entries for threads

Signed-off-by: Paulo Alcantara <pcacjr@profusion.mobi>


SVN revision: 81584
This commit is contained in:
Paulo Alcantara 2012-12-21 21:13:06 +00:00 committed by Leandro Pereira
parent fb97c82882
commit 0809c7de3f
3 changed files with 25 additions and 3 deletions

View File

@ -891,6 +891,12 @@ evas_cache2_image_scale_load(Image_Entry *im, int src_x, int src_y, int src_w, i
return im;
}
EAPI void
evas_cache2_image_ref(Image_Entry *im)
{
im->references++;
}
EAPI void
evas_cache2_image_close(Image_Entry *im)
{

View File

@ -61,6 +61,7 @@ EAPI void evas_cache2_shutdown(Evas_Cache2 *cache);
EAPI Image_Entry * evas_cache2_image_open(Evas_Cache2 *cache, const char *path, const char *key, RGBA_Image_Loadopts *lo, int *error);
EAPI Image_Entry *evas_cache2_image_scale_load(Image_Entry *im, int src_x, int src_y, int src_w, int src_h, int dst_w, int dst_h, int smooth);
EAPI int evas_cache2_image_open_wait(Image_Entry *im);
EAPI void evas_cache2_image_ref(Image_Entry *im);
EAPI void evas_cache2_image_close(Image_Entry *im);
EAPI int evas_cache2_image_load_data(Image_Entry *ie);
EAPI void evas_cache2_image_unload_data(Image_Entry *im);

View File

@ -1127,6 +1127,11 @@ eng_image_data_preload_cancel(void *data EINA_UNUSED, void *image, const void *t
static void
_drop_cache_ref(void *target, Evas_Callback_Type type EINA_UNUSED, void *event_info EINA_UNUSED)
{
#ifdef EVAS_CSERVE2
if (evas_cserve2_use_get())
evas_cache2_image_close((Image_Entry *)target);
else
#endif
evas_cache_image_drop((Image_Entry *)target);
}
@ -1163,6 +1168,11 @@ _image_draw_thread_cmd(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc,
if (!(RECTS_INTERSECT(dst_region_x, dst_region_y, dst_region_w, dst_region_h,
0, 0, dst->cache_entry.w, dst->cache_entry.h))) return;
#ifdef EVAS_CSERVE2
if (evas_cserve2_use_get())
evas_cache2_image_ref((Image_Entry *)src);
else
#endif
evas_cache_image_ref((Image_Entry *)src);
cr.image = src;
@ -1452,6 +1462,11 @@ _map_draw_thread_cmd(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, RG
Evas_Thread_Command_Map cm;
int clip_x, clip_y, clip_w, clip_h;
#ifdef EVAS_CSERVE2
if (evas_cserve2_use_get())
evas_cache2_image_ref((Image_Entry *)src);
else
#endif
evas_cache_image_ref((Image_Entry *)src);
cm.image = src;