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,7 +1127,12 @@ 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)
{
evas_cache_image_drop((Image_Entry *)target);
#ifdef EVAS_CSERVE2
if (evas_cserve2_use_get())
evas_cache2_image_close((Image_Entry *)target);
else
#endif
evas_cache_image_drop((Image_Entry *)target);
}
static void
@ -1163,7 +1168,12 @@ _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;
evas_cache_image_ref((Image_Entry *)src);
#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;
cr.surface = dst;
@ -1452,7 +1462,12 @@ _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;
evas_cache_image_ref((Image_Entry *)src);
#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;
memcpy(&cm.image_ctx, dc, sizeof(*dc));