summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-08-30 12:05:17 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-08-30 12:05:17 +0100
commit119d9f39dd9ba67068a6abb77990ea859d4266f6 (patch)
tree265b0eff5752b59ccc9a73b7a5317c125c9c4ecd
parent5a125ccfa4fcf3f9e38d24b0c7f08c3bc1ab239f (diff)
evas - image cache - fix loading with skip head on to load changed files
changed files were not being detected as stas was being skipped if skip head was enabled. this means we totally didnt see changes to files if loaded this way until caches were cycled/flushed/removed @fix
-rw-r--r--src/lib/evas/cache/evas_cache_image.c46
1 files changed, 16 insertions, 30 deletions
diff --git a/src/lib/evas/cache/evas_cache_image.c b/src/lib/evas/cache/evas_cache_image.c
index 32cc83db8b..747fcf9c89 100644
--- a/src/lib/evas/cache/evas_cache_image.c
+++ b/src/lib/evas/cache/evas_cache_image.c
@@ -862,7 +862,6 @@ evas_cache_image_request(Evas_Cache_Image *cache, const char *file,
862 size_t key_length; 862 size_t key_length;
863 struct stat st; 863 struct stat st;
864 Image_Timestamp tstamp; 864 Image_Timestamp tstamp;
865 Eina_Bool skip = lo->skip_head;
866 Evas_Image_Load_Opts tlo; 865 Evas_Image_Load_Opts tlo;
867 866
868 if (!file) 867 if (!file)
@@ -885,7 +884,7 @@ evas_cache_image_request(Evas_Cache_Image *cache, const char *file,
885 size += key_length; 884 size += key_length;
886 size += _evas_cache_image_loadopts_append(hkey + size, &lo); 885 size += _evas_cache_image_loadopts_append(hkey + size, &lo);
887 tlo = *lo; 886 tlo = *lo;
888 tlo.skip_head = skip; 887 tlo.skip_head = lo->skip_head;
889 888
890 /* find image by key in active hash */ 889 /* find image by key in active hash */
891 SLKL(engine_lock); 890 SLKL(engine_lock);
@@ -895,15 +894,13 @@ evas_cache_image_request(Evas_Cache_Image *cache, const char *file,
895 int ok = 1; 894 int ok = 1;
896 895
897 stat_done = 1; 896 stat_done = 1;
898 if (!skip) 897 if (stat(file, &st) < 0)
899 { 898 {
900 if (stat(file, &st) < 0) 899 stat_failed = 1;
901 { 900 ok = 0;
902 stat_failed = 1;
903 ok = 0;
904 }
905 else if (!_timestamp_compare(&(im->tstamp), &st)) ok = 0;
906 } 901 }
902 else if (!_timestamp_compare(&(im->tstamp), &st)) ok = 0;
903
907 if (ok) goto on_ok; 904 if (ok) goto on_ok;
908 /* image we found doesn't match what's on disk (stat info wise) 905 /* image we found doesn't match what's on disk (stat info wise)
909 * so dirty the active cache entry so we never find it again. this 906 * so dirty the active cache entry so we never find it again. this
@@ -925,20 +922,17 @@ evas_cache_image_request(Evas_Cache_Image *cache, const char *file,
925 { 922 {
926 int ok = 1; 923 int ok = 1;
927 924
928 if (!skip) 925 if (!stat_done)
929 { 926 {
930 if (!stat_done) 927 stat_done = 1;
928 if (stat(file, &st) < 0)
931 { 929 {
932 stat_done = 1; 930 stat_failed = 1;
933 if (stat(file, &st) < 0)
934 {
935 stat_failed = 1;
936 ok = 0; 931 ok = 0;
937 }
938 else if (!_timestamp_compare(&(im->tstamp), &st)) ok = 0;
939 } 932 }
940 else if (!_timestamp_compare(&(im->tstamp), &st)) ok = 0; 933 else if (!_timestamp_compare(&(im->tstamp), &st)) ok = 0;
941 } 934 }
935 else if (!_timestamp_compare(&(im->tstamp), &st)) ok = 0;
942 936
943 if (ok) 937 if (ok)
944 { 938 {
@@ -963,21 +957,13 @@ evas_cache_image_request(Evas_Cache_Image *cache, const char *file,
963 } 957 }
964 if (stat_failed) goto on_stat_error; 958 if (stat_failed) goto on_stat_error;
965 959
966 if (!skip) 960 if (!stat_done)
967 {
968 if (!stat_done)
969 {
970 if (stat(file, &st) < 0) goto on_stat_error;
971 }
972 _timestamp_build(&tstamp, &st);
973 im = _evas_cache_image_entry_new(cache, hkey, &tstamp, NULL,
974 file, key, &tlo, error);
975 }
976 else
977 { 961 {
978 im = _evas_cache_image_entry_new(cache, hkey, NULL, NULL, 962 if (stat(file, &st) < 0) goto on_stat_error;
979 file, key, &tlo, error);
980 } 963 }
964 _timestamp_build(&tstamp, &st);
965 im = _evas_cache_image_entry_new(cache, hkey, &tstamp, NULL,
966 file, key, &tlo, error);
981 if (!im) goto on_stat_error; 967 if (!im) goto on_stat_error;
982 if (cache->func.debug) cache->func.debug("request", im); 968 if (cache->func.debug) cache->func.debug("request", im);
983 969