summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2013-09-04 16:14:37 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2013-10-28 15:47:15 +0900
commit97d9fab7042f213498268dfc58636b823380245c (patch)
tree344ac20e4aa4854d23dba9f7afada5b6a2759e65 /src/modules
parentbfe3fe27df9384642d8f3b277ec694c9d42fc0c9 (diff)
evas/cserve2: Fallback to normal cache for animated gifs
Pass around "animated" flag for images that can be animated. Fallback to local cache if the image is animated. Implementing support for animated images in cserve2 does not seem to make a lot of sense considering each frame must be requested independently in real time,... and to be honest there doesn't seem to be any valid use case anyway :)
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/evas/engines/software_generic/evas_engine.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/modules/evas/engines/software_generic/evas_engine.c b/src/modules/evas/engines/software_generic/evas_engine.c
index 8b3441444b..577d3af4b0 100644
--- a/src/modules/evas/engines/software_generic/evas_engine.c
+++ b/src/modules/evas/engines/software_generic/evas_engine.c
@@ -949,10 +949,19 @@ eng_image_load(void *data EINA_UNUSED, const char *file, const char *key, int *e
949 ie = evas_cache2_image_open(evas_common_image_cache2_get(), 949 ie = evas_cache2_image_open(evas_common_image_cache2_get(),
950 file, key, lo, error); 950 file, key, lo, error);
951 if (ie) 951 if (ie)
952 *error = evas_cache2_image_open_wait(ie); 952 {
953 *error = evas_cache2_image_open_wait(ie);
954 if ((*error != EVAS_LOAD_ERROR_NONE) && ie->animated.animated)
955 {
956 evas_cache2_image_close(ie);
957 goto use_local_cache;
958 }
959 }
953 return ie; 960 return ie;
954 } 961 }
962use_local_cache:
955#endif 963#endif
964
956 return evas_common_load_image_from_file(file, key, lo, error); 965 return evas_common_load_image_from_file(file, key, lo, error);
957} 966}
958 967
@@ -968,10 +977,19 @@ eng_image_mmap(void *data EINA_UNUSED, Eina_File *f, const char *key, int *error
968 ie = evas_cache2_image_open(evas_common_image_cache2_get(), 977 ie = evas_cache2_image_open(evas_common_image_cache2_get(),
969 eina_file_filename_get(f), key, lo, error); 978 eina_file_filename_get(f), key, lo, error);
970 if (ie) 979 if (ie)
971 *error = evas_cache2_image_open_wait(ie); 980 {
981 *error = evas_cache2_image_open_wait(ie);
982 if ((*error != EVAS_LOAD_ERROR_NONE) && ie->animated.animated)
983 {
984 evas_cache2_image_close(ie);
985 goto use_local_cache;
986 }
987 }
972 return ie; 988 return ie;
973 } 989 }
990use_local_cache:
974#endif 991#endif
992
975 return evas_common_load_image_from_mmap(f, key, lo, error); 993 return evas_common_load_image_from_mmap(f, key, lo, error);
976} 994}
977 995
@@ -1295,7 +1313,7 @@ eng_image_draw(void *data EINA_UNUSED, void *context, void *surface, void *image
1295 if (im->cache_entry.space == EVAS_COLORSPACE_ARGB8888) 1313 if (im->cache_entry.space == EVAS_COLORSPACE_ARGB8888)
1296 { 1314 {
1297#if EVAS_CSERVE2 1315#if EVAS_CSERVE2
1298 if (evas_cserve2_use_get()) 1316 if (evas_cserve2_use_get() && evas_cache2_image_cached(&im->cache_entry))
1299 evas_cache2_image_load_data(&im->cache_entry); 1317 evas_cache2_image_load_data(&im->cache_entry);
1300 else 1318 else
1301#endif 1319#endif