raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=119d9f39dd9ba67068a6abb77990ea859d4266f6

commit 119d9f39dd9ba67068a6abb77990ea859d4266f6
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
Date:   Sun Aug 30 12:05:17 2020 +0100

    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
---
 src/lib/evas/cache/evas_cache_image.c | 46 ++++++++++++-----------------------
 1 file 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,
    size_t                key_length;
    struct stat           st;
    Image_Timestamp       tstamp;
-   Eina_Bool             skip = lo->skip_head;
    Evas_Image_Load_Opts  tlo;
 
    if (!file)
@@ -885,7 +884,7 @@ evas_cache_image_request(Evas_Cache_Image *cache, const 
char *file,
    size += key_length;
    size += _evas_cache_image_loadopts_append(hkey + size, &lo);
    tlo = *lo;
-   tlo.skip_head = skip;
+   tlo.skip_head = lo->skip_head;
 
    /* find image by key in active hash */
    SLKL(engine_lock);
@@ -895,15 +894,13 @@ evas_cache_image_request(Evas_Cache_Image *cache, const 
char *file,
         int ok = 1;
 
         stat_done = 1;
-        if (!skip)
+        if (stat(file, &st) < 0)
           {
-             if (stat(file, &st) < 0)
-               {
-                  stat_failed = 1;
-                  ok = 0;
-               }
-             else if (!_timestamp_compare(&(im->tstamp), &st)) ok = 0;
+             stat_failed = 1;
+             ok = 0;
           }
+        else if (!_timestamp_compare(&(im->tstamp), &st)) ok = 0;
+
         if (ok) goto on_ok;
         /* image we found doesn't match what's on disk (stat info wise)
          * 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,
      {
         int ok = 1;
 
-        if (!skip)
+        if (!stat_done)
           {
-             if (!stat_done)
+             stat_done = 1;
+             if (stat(file, &st) < 0)
                {
-                  stat_done = 1;
-                  if (stat(file, &st) < 0)
-                    {
-                       stat_failed = 1;
+                  stat_failed = 1;
                        ok = 0;
-                    }
-                  else if (!_timestamp_compare(&(im->tstamp), &st)) ok = 0;
                }
              else if (!_timestamp_compare(&(im->tstamp), &st)) ok = 0;
           }
+        else if (!_timestamp_compare(&(im->tstamp), &st)) ok = 0;
 
         if (ok)
           {
@@ -963,21 +957,13 @@ evas_cache_image_request(Evas_Cache_Image *cache, const 
char *file,
      }
    if (stat_failed) goto on_stat_error;
 
-   if (!skip)
-     {
-        if (!stat_done)
-          {
-             if (stat(file, &st) < 0) goto on_stat_error;
-          }
-        _timestamp_build(&tstamp, &st);
-        im = _evas_cache_image_entry_new(cache, hkey, &tstamp, NULL,
-                                         file, key, &tlo, error);
-     }
-   else
+   if (!stat_done)
      {
-        im = _evas_cache_image_entry_new(cache, hkey, NULL, NULL,
-                                         file, key, &tlo, error);
+        if (stat(file, &st) < 0) goto on_stat_error;
      }
+   _timestamp_build(&tstamp, &st);
+   im = _evas_cache_image_entry_new(cache, hkey, &tstamp, NULL,
+                                    file, key, &tlo, error);
    if (!im) goto on_stat_error;
    if (cache->func.debug) cache->func.debug("request", im);
 

-- 


Reply via email to