diff --git a/legacy/evas/src/lib/engines/common/evas_image_load.c b/legacy/evas/src/lib/engines/common/evas_image_load.c index a45b27160c..dec999ec01 100644 --- a/legacy/evas/src/lib/engines/common/evas_image_load.c +++ b/legacy/evas/src/lib/engines/common/evas_image_load.c @@ -1,10 +1,6 @@ #include "evas_common.h" #include "evas_private.h" -#include -#include -#include - extern Evas_List *evas_modules; EAPI RGBA_Image * @@ -17,6 +13,7 @@ evas_common_load_image_from_file(const char *file, const char *key, RGBA_Image_L char *loader = NULL; Evas_Module *em; struct stat st; +// time_t t; if (file == NULL) return NULL; @@ -26,12 +23,14 @@ evas_common_load_image_from_file(const char *file, const char *key, RGBA_Image_L evas_common_image_ref(im); return im; } +// t = time(); if (stat(file, &st) < 0) return NULL; im = evas_common_image_new(); if (!im) return NULL; im->timestamp = st.st_mtime; +// im->last_stat = t; if (lo) im->load_opts = *lo; diff --git a/legacy/evas/src/lib/engines/common/evas_image_main.c b/legacy/evas/src/lib/engines/common/evas_image_main.c index f5c197dfdb..465d95c72b 100644 --- a/legacy/evas/src/lib/engines/common/evas_image_main.c +++ b/legacy/evas/src/lib/engines/common/evas_image_main.c @@ -478,7 +478,8 @@ evas_common_image_find(const char *file, const char *key, DATA64 timestamp, RGBA char buf[4096 + 1024]; Evas_Object_List *l; struct stat st; - static time_t last_stat = 0, t, mt; + static time_t last_stat = 0; + time_t t, mt = 0; if ((!file) && (!key)) return NULL; if (!file) return NULL; @@ -500,33 +501,32 @@ evas_common_image_find(const char *file, const char *key, DATA64 timestamp, RGBA else snprintf(buf, sizeof(buf), "//@/%i/%1.5f/%ix%i//%s", lo->scale_down_by, lo->dpi, lo->w, lo->h, file); } +// t = time(); im = evas_hash_find(images, buf); - t = time(); if (im) { - if ((t - last_stat) < STAT_GAP) - return im; - else +// if ((t - im->last_stat) < STAT_GAP) +// return im; +// else { struct stat st; - if (stat(file, &st) != 0) return NULL; + if (stat(file, &st) < 0) return NULL; mt = st.st_mtime; if (mt == im->timestamp) { - last_stat = t; +// im->last_stat = t; return im; } } } else { - if ((t - last_stat) >= STAT_GAP) - { - if (stat(file, &st) != 0) return NULL; +// if ((t - last_stat) >= STAT_GAP) +// { + if (stat(file, &st) < 0) return NULL; mt = st.st_mtime; - last_stat = t; - } +// } } for (l = cache; l; l = l->next) @@ -550,13 +550,13 @@ evas_common_image_find(const char *file, const char *key, DATA64 timestamp, RGBA ok++; else continue; - if ((t - last_stat) >= STAT_GAP) - { +// if ((t - im->last_stat) >= STAT_GAP) +// { if (im->timestamp == mt) ok++; else continue; - } - else ok++; +// } +// else ok++; if ((lo->scale_down_by == lo2->scale_down_by) && (lo->dpi == lo2->dpi) && (lo->w == lo2->w) && @@ -564,6 +564,7 @@ evas_common_image_find(const char *file, const char *key, DATA64 timestamp, RGBA ok++; else continue; +// im->last_stat = t; return im; } /* diff --git a/legacy/evas/src/lib/include/evas_common.h b/legacy/evas/src/lib/include/evas_common.h index 42e9c88056..b069df9d5d 100644 --- a/legacy/evas/src/lib/include/evas_common.h +++ b/legacy/evas/src/lib/include/evas_common.h @@ -348,12 +348,13 @@ struct _RGBA_Image char *comment; } info; int references; - time_t timestamp; void *extended_info; RGBA_Image_Loadopts load_opts; unsigned char scale; RGBA_Pipe *pipe; int ref; + time_t timestamp; + time_t laststat; struct { void *data; int space;