jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=42d2f8a12b4706b79e7cf16162d34f259bdc23d4

commit 42d2f8a12b4706b79e7cf16162d34f259bdc23d4
Author: Jean-Philippe Andre <jp.an...@samsung.com>
Date:   Wed Nov 19 19:06:18 2014 +0900

    Evas: Set image load_error after load
    
    In case of async preload, this avoids loading an image twice
    if it already failed loading.
    
    Thanks Minkyoung Kim for spotting this.
---
 src/modules/evas/engines/gl_common/evas_gl_image.c | 35 +++++++++++++---------
 1 file changed, 21 insertions(+), 14 deletions(-)

diff --git a/src/modules/evas/engines/gl_common/evas_gl_image.c 
b/src/modules/evas/engines/gl_common/evas_gl_image.c
index 9e852bb..4faf6b2 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_image.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_image.c
@@ -762,6 +762,7 @@ void
 evas_gl_common_image_update(Evas_Engine_GL_Context *gc, Evas_GL_Image *im)
 {
    Image_Entry *ie;
+
    if (!im->im) return;
    ie = &im->im->cache_entry;
    evas_gl_common_image_alloc_ensure(im);
@@ -808,33 +809,37 @@ evas_gl_common_image_update(Evas_Engine_GL_Context *gc, 
Evas_GL_Image *im)
 #ifdef EVAS_CSERVE2
               if (evas_cache2_image_cached(ie))
                 {
-                   evas_cache2_image_load_data(ie);
-                   evas_gl_common_texture_update(im->tex, im->im);
+                   ie->load_error = evas_cache2_image_load_data(ie);
+                   if (ie->load_error == EVAS_LOAD_ERROR_NONE)
+                     evas_gl_common_texture_update(im->tex, im->im);
                    evas_cache2_image_unload_data(ie);
                 }
               else
 #endif
                 {
-                   evas_cache_image_load_data(ie);
-                   evas_gl_common_texture_update(im->tex, im->im);
+                   ie->load_error = evas_cache_image_load_data(ie);
+                   if (ie->load_error == EVAS_LOAD_ERROR_NONE)
+                     evas_gl_common_texture_update(im->tex, im->im);
                    evas_cache_image_unload_data(ie);
                 }
              ie->flags.updated_data = 0;
           }
-        if (!im->tex)
+        else if ((!im->tex) && (ie->load_error == EVAS_LOAD_ERROR_NONE))
           {
 #ifdef EVAS_CSERVE2
              if (evas_cache2_image_cached(ie))
                {
-                  evas_cache2_image_load_data(ie);
-                  im->tex = evas_gl_common_texture_new(gc, im->im);
+                  ie->load_error = evas_cache2_image_load_data(ie);
+                  if (ie->load_error == EVAS_LOAD_ERROR_NONE)
+                    im->tex = evas_gl_common_texture_new(gc, im->im);
                   evas_cache2_image_unload_data(ie);
                }
              else
 #endif
                {
-                  evas_cache_image_load_data(ie);
-                  im->tex = evas_gl_common_texture_new(gc, im->im);
+                  ie->load_error = evas_cache_image_load_data(ie);
+                  if (ie->load_error == EVAS_LOAD_ERROR_NONE)
+                    im->tex = evas_gl_common_texture_new(gc, im->im);
                   evas_cache_image_unload_data(ie);
                }
           }
@@ -844,14 +849,16 @@ evas_gl_common_image_update(Evas_Engine_GL_Context *gc, 
Evas_GL_Image *im)
       case EVAS_COLORSPACE_ETC1_ALPHA:
         if ((im->tex) && (im->dirty))
           {
-             evas_cache_image_load_data(ie);
-             evas_gl_common_texture_rgb_a_pair_update(im->tex, im->im);
+             ie->load_error = evas_cache_image_load_data(ie);
+             if (ie->load_error == EVAS_LOAD_ERROR_NONE)
+               evas_gl_common_texture_rgb_a_pair_update(im->tex, im->im);
              evas_cache_image_unload_data(ie);
           }
-        else if ((!im->tex))
+        else if ((!im->tex) && (ie->load_error == EVAS_LOAD_ERROR_NONE))
           {
-             evas_cache_image_load_data(ie);
-             im->tex = evas_gl_common_texture_rgb_a_pair_new(gc, im->im);
+             ie->load_error = evas_cache_image_load_data(ie);
+             if (ie->load_error == EVAS_LOAD_ERROR_NONE)
+               im->tex = evas_gl_common_texture_rgb_a_pair_new(gc, im->im);
              evas_cache_image_unload_data(ie);
           }
         im->dirty = 0;

-- 


Reply via email to