summaryrefslogtreecommitdiff
path: root/src/lib/evas/cache2
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2013-07-03 18:18:00 +0900
committerCedric Bail <cedric.bail@samsung.com>2013-07-04 13:02:48 +0900
commit09a5c28e5b3b79432101cab5e565d9ea2bf83745 (patch)
treed1921e715dbc526987cd050f41470afe7ebe8f0d /src/lib/evas/cache2
parent7c7c2310152e5421b454729548b1af49b67826e4 (diff)
evas/cserve2: no cache for large images or non-smooth
The concept is taken from scalecache. I am not sure of the performance impact.
Diffstat (limited to 'src/lib/evas/cache2')
-rw-r--r--src/lib/evas/cache2/evas_cache2.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/lib/evas/cache2/evas_cache2.c b/src/lib/evas/cache2/evas_cache2.c
index 302c65800b..6d7bdfa7b2 100644
--- a/src/lib/evas/cache2/evas_cache2.c
+++ b/src/lib/evas/cache2/evas_cache2.c
@@ -844,7 +844,9 @@ _scaled_image_find(Image_Entry *im, int src_x, int src_y, int src_w, int src_h,
844} 844}
845 845
846EAPI Image_Entry * 846EAPI Image_Entry *
847evas_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) 847evas_cache2_image_scale_load(Image_Entry *im,
848 int src_x, int src_y, int src_w, int src_h,
849 int dst_w, int dst_h, int smooth)
848{ 850{
849 size_t pathlen, keylen, size; 851 size_t pathlen, keylen, size;
850 char *hkey; 852 char *hkey;
@@ -852,6 +854,16 @@ evas_cache2_image_scale_load(Image_Entry *im, int src_x, int src_y, int src_w, i
852 int error = EVAS_LOAD_ERROR_NONE; 854 int error = EVAS_LOAD_ERROR_NONE;
853 Image_Entry *ret; 855 Image_Entry *ret;
854 856
857 if (!smooth && im->scale_hint != EVAS_IMAGE_SCALE_HINT_STATIC)
858 goto parent_out;
859
860 // Concept from scalecache: don't cache large images.
861 if (((((dst_w > 640) || (dst_h > 640)) &&
862 ((dst_w * dst_h) > (480 * 480))) ||
863 (im->scale_hint == EVAS_IMAGE_SCALE_HINT_STATIC)) &&
864 (im->scale_hint != EVAS_IMAGE_SCALE_HINT_DYNAMIC))
865 goto parent_out;
866
855 if (((!im->file) || ((!im->file) && (!im->key))) || 867 if (((!im->file) || ((!im->file) && (!im->key))) ||
856 ((src_w == 0) || (src_h == 0) || (dst_w == 0) || (dst_h == 0)) || 868 ((src_w == 0) || (src_h == 0) || (dst_w == 0) || (dst_h == 0)) ||
857 (im->scale_hint == EVAS_IMAGE_SCALE_HINT_DYNAMIC)) goto parent_out; 869 (im->scale_hint == EVAS_IMAGE_SCALE_HINT_DYNAMIC)) goto parent_out;