summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaulo Alcantara <pcacjr@profusion.mobi>2012-12-21 21:13:06 +0000
committerLeandro Pereira <leandro@profusion.mobi>2012-12-21 21:13:06 +0000
commit0809c7de3fdd302f311e12378adeacd6d02a9037 (patch)
tree061ee3c3a1b41149e8ba2ac9c41f2fbd94df65ec /src
parentfb97c82882a46225886204109880cac4f8704340 (diff)
efl/cserve2: Fix ref/unef of image entries for threads
Signed-off-by: Paulo Alcantara <pcacjr@profusion.mobi> SVN revision: 81584
Diffstat (limited to 'src')
-rw-r--r--src/lib/evas/cache2/evas_cache2.c6
-rw-r--r--src/lib/evas/cache2/evas_cache2.h1
-rw-r--r--src/modules/evas/engines/software_generic/evas_engine.c21
3 files changed, 25 insertions, 3 deletions
diff --git a/src/lib/evas/cache2/evas_cache2.c b/src/lib/evas/cache2/evas_cache2.c
index 9d5d186ed6..46cca8e169 100644
--- a/src/lib/evas/cache2/evas_cache2.c
+++ b/src/lib/evas/cache2/evas_cache2.c
@@ -892,6 +892,12 @@ evas_cache2_image_scale_load(Image_Entry *im, int src_x, int src_y, int src_w, i
892} 892}
893 893
894EAPI void 894EAPI void
895evas_cache2_image_ref(Image_Entry *im)
896{
897 im->references++;
898}
899
900EAPI void
895evas_cache2_image_close(Image_Entry *im) 901evas_cache2_image_close(Image_Entry *im)
896{ 902{
897 Evas_Cache2 *cache; 903 Evas_Cache2 *cache;
diff --git a/src/lib/evas/cache2/evas_cache2.h b/src/lib/evas/cache2/evas_cache2.h
index 8fc300aca7..5fddd1708e 100644
--- a/src/lib/evas/cache2/evas_cache2.h
+++ b/src/lib/evas/cache2/evas_cache2.h
@@ -61,6 +61,7 @@ EAPI void evas_cache2_shutdown(Evas_Cache2 *cache);
61EAPI Image_Entry * evas_cache2_image_open(Evas_Cache2 *cache, const char *path, const char *key, RGBA_Image_Loadopts *lo, int *error); 61EAPI Image_Entry * evas_cache2_image_open(Evas_Cache2 *cache, const char *path, const char *key, RGBA_Image_Loadopts *lo, int *error);
62EAPI 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); 62EAPI 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);
63EAPI int evas_cache2_image_open_wait(Image_Entry *im); 63EAPI int evas_cache2_image_open_wait(Image_Entry *im);
64EAPI void evas_cache2_image_ref(Image_Entry *im);
64EAPI void evas_cache2_image_close(Image_Entry *im); 65EAPI void evas_cache2_image_close(Image_Entry *im);
65EAPI int evas_cache2_image_load_data(Image_Entry *ie); 66EAPI int evas_cache2_image_load_data(Image_Entry *ie);
66EAPI void evas_cache2_image_unload_data(Image_Entry *im); 67EAPI void evas_cache2_image_unload_data(Image_Entry *im);
diff --git a/src/modules/evas/engines/software_generic/evas_engine.c b/src/modules/evas/engines/software_generic/evas_engine.c
index b4d1bfc8ce..c91ba6c91a 100644
--- a/src/modules/evas/engines/software_generic/evas_engine.c
+++ b/src/modules/evas/engines/software_generic/evas_engine.c
@@ -1127,7 +1127,12 @@ eng_image_data_preload_cancel(void *data EINA_UNUSED, void *image, const void *t
1127static void 1127static void
1128_drop_cache_ref(void *target, Evas_Callback_Type type EINA_UNUSED, void *event_info EINA_UNUSED) 1128_drop_cache_ref(void *target, Evas_Callback_Type type EINA_UNUSED, void *event_info EINA_UNUSED)
1129{ 1129{
1130 evas_cache_image_drop((Image_Entry *)target); 1130#ifdef EVAS_CSERVE2
1131 if (evas_cserve2_use_get())
1132 evas_cache2_image_close((Image_Entry *)target);
1133 else
1134#endif
1135 evas_cache_image_drop((Image_Entry *)target);
1131} 1136}
1132 1137
1133static void 1138static void
@@ -1163,7 +1168,12 @@ _image_draw_thread_cmd(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc,
1163 if (!(RECTS_INTERSECT(dst_region_x, dst_region_y, dst_region_w, dst_region_h, 1168 if (!(RECTS_INTERSECT(dst_region_x, dst_region_y, dst_region_w, dst_region_h,
1164 0, 0, dst->cache_entry.w, dst->cache_entry.h))) return; 1169 0, 0, dst->cache_entry.w, dst->cache_entry.h))) return;
1165 1170
1166 evas_cache_image_ref((Image_Entry *)src); 1171#ifdef EVAS_CSERVE2
1172 if (evas_cserve2_use_get())
1173 evas_cache2_image_ref((Image_Entry *)src);
1174 else
1175#endif
1176 evas_cache_image_ref((Image_Entry *)src);
1167 1177
1168 cr.image = src; 1178 cr.image = src;
1169 cr.surface = dst; 1179 cr.surface = dst;
@@ -1452,7 +1462,12 @@ _map_draw_thread_cmd(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, RG
1452 Evas_Thread_Command_Map cm; 1462 Evas_Thread_Command_Map cm;
1453 int clip_x, clip_y, clip_w, clip_h; 1463 int clip_x, clip_y, clip_w, clip_h;
1454 1464
1455 evas_cache_image_ref((Image_Entry *)src); 1465#ifdef EVAS_CSERVE2
1466 if (evas_cserve2_use_get())
1467 evas_cache2_image_ref((Image_Entry *)src);
1468 else
1469#endif
1470 evas_cache_image_ref((Image_Entry *)src);
1456 1471
1457 cm.image = src; 1472 cm.image = src;
1458 memcpy(&cm.image_ctx, dc, sizeof(*dc)); 1473 memcpy(&cm.image_ctx, dc, sizeof(*dc));