evas/cserve2: Fix animated Gifs support with cs2
authorJean-Philippe Andre <jp.andre@samsung.com>
Fri, 27 Sep 2013 05:46:48 +0000 (14:46 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Mon, 28 Oct 2013 06:47:15 +0000 (15:47 +0900)
cserve2 does not support animated Gifs, as the animated icon
logic doesn't match cserve2 logic.
Also, there is probably no need to cache these into shared
buffers anyways :)

Solution: fallback to normal cache (and delete current entry in
the client)

src/lib/evas/cache2/evas_cache2.c
src/lib/evas/common/evas_image_load.c
src/lib/evas/common/evas_image_scalecache.c

index b6b1ead..a9ed8ca 100644 (file)
@@ -966,7 +966,7 @@ evas_cache2_image_close(Image_Entry *im)
    if (references > 0)
      return;
 
-   if (im->flags.dirty)
+   if (im->flags.dirty || im->animated.animated)
      {
         _evas_cache2_image_entry_delete(cache, im);
         return;
index c945442..174f1b0 100644 (file)
@@ -243,18 +243,10 @@ evas_common_load_rgba_image_module_from_file(Image_Entry *ie)
    struct evas_image_foreach_loader_data fdata;
 
 #ifdef EVAS_CSERVE2
-   if (evas_cserve2_use_get())
-     {
-        ERR("This function shouldn't be called anymore!");
-        // DBG("try cserve2 '%s' '%s'", ie->file, ie->key ? ie->key : "");
-        // if (evas_cserve2_image_load(ie, ie->file, ie->key, &(ie->load_opts)))
-        //   {
-        //      DBG("try cserve2 '%s' '%s' loaded!",
-        //          ie->file, ie->key ? ie->key : "");
-        //      return EVAS_LOAD_ERROR_NONE;
-        //   }
-     }
+   if (evas_cserve2_use_get() && evas_cache2_image_cached(ie))
+     CRIT("This function shouldn't be called anymore!");
 #endif
+
    if (ie->f)
      {
         len = strlen(eina_file_filename_get(ie->f));
@@ -368,25 +360,8 @@ evas_common_load_rgba_image_data_from_file(Image_Entry *ie)
    if ((ie->flags.loaded) && (!ie->animated.animated)) return EVAS_LOAD_ERROR_GENERIC;
 
 #ifdef EVAS_CSERVE2
-   if (ie->data1)
-     {
-        ERR("This function shouldn't be called anymore!");
-        // DBG("try cserve2 image data '%s' '%s'",
-        //     ie->file, ie->key ? ie->key : "");
-        // if (evas_cserve2_image_data_load(ie))
-        //   {
-        //      RGBA_Image *im = (RGBA_Image *)ie;
-        //      im->image.data = evas_cserve2_image_data_get(ie);
-        //      DBG("try cserve2 image data '%s' '%s' loaded!",
-        //          ie->file, ie->key ? ie->key : "");
-        //      if (im->image.data)
-        //        {
-        //           im->image.no_free = 1;
-        //           return EVAS_LOAD_ERROR_NONE;
-        //        }
-        //   }
-        // return EVAS_LOAD_ERROR_GENERIC;
-     }
+   if (evas_cserve2_use_get() && evas_cache2_image_cached(ie))
+     CRIT("This function shouldn't be called anymore!");
 #endif
 
    if (!ie->info.module) return EVAS_LOAD_ERROR_GENERIC;
index 3802f0c..1a8229f 100644 (file)
@@ -663,7 +663,7 @@ evas_common_rgba_image_scalecache_do_cbs(Image_Entry *ie, RGBA_Image *dst,
         if (im->cache_entry.space == EVAS_COLORSPACE_ARGB8888)
           {
 #ifdef EVAS_CSERVE2
-             if (evas_cserve2_use_get())
+             if (evas_cserve2_use_get() && evas_cache2_image_cached(&im->cache_entry))
                evas_cache2_image_load_data(&im->cache_entry);
              else
 #endif