evas/gl : Do not re-preload image data if texture is successfully uploaded with image... 01/55301/1
authorMinkyoung Kim <mer.kim@samsung.com>
Fri, 18 Dec 2015 07:49:17 +0000 (16:49 +0900)
committerJaeun Choi <jaeun12.choi@samsung.com>
Wed, 23 Dec 2015 03:05:08 +0000 (12:05 +0900)
Summary:
'cached' flag is not enough to check whethere data is loaded and texture is uploaded.
so check more options for prevent re-preload image data on gl-backend.

Test Plan: Local Test (elementary_test : elm images)

Reviewers: jpeg, eunue

Reviewed By: jpeg

Subscribers: cedric, jiin.moon, wonsik, spacegrapher

Differential Revision: https://phab.enlightenment.org/D3446

Change-Id: Ia15c6ec4a22a6b48921baab5d00992bc0918c477
Origin: upstream

src/lib/evas/cache/evas_cache_image.c
src/lib/evas/include/evas_common_private.h
src/modules/evas/engines/gl_common/evas_gl_texture.c
src/modules/evas/engines/gl_generic/evas_engine.c

index b6c61f5..e1f8c69 100644 (file)
@@ -1268,7 +1268,7 @@ evas_cache_image_preload_data(Image_Entry *im, const Eo *target,
 {
    RGBA_Image *img = (RGBA_Image *)im;
 
-   if (((im->flags.loaded) && (img->image.data)) || im->flags.cached)
+   if (((im->flags.loaded) && (img->image.data)) || (im->flags.textured && !im->flags.updated_data))
      {
         evas_object_inform_call_image_preloaded((Evas_Object*)target);
         return;
index 5125f4e..addf056 100644 (file)
@@ -566,6 +566,7 @@ struct _Image_Entry_Flags
 
    Eina_Bool updated_data  : 1;
    Eina_Bool flipped       : 1;
+   Eina_Bool textured      : 1;
 };
 
 struct _Image_Entry_Frame
index 3107507..9c31dda 100644 (file)
@@ -1427,6 +1427,7 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
      }
 
    evas_gl_common_texture_upload(tex, im, bytes_count);
+   im->cache_entry.flags.textured = 1;
 }
 
 void
@@ -1484,6 +1485,12 @@ evas_gl_common_texture_free(Evas_GL_Texture *tex, Eina_Bool force EINA_UNUSED)
    tex->ptv2 = NULL;
    tex->ptuv = NULL;
 
+   if (tex->im) 
+     {
+        tex->im->tex = NULL;
+        if (tex->im->im) tex->im->im->cache_entry.flags.textured = 0;
+     }
+
    evas_gl_common_texture_light_free(tex);
 }
 
index 35dae64..22570e7 100644 (file)
@@ -1051,6 +1051,8 @@ eng_image_data_preload_request(void *data, void *image, const Eo *target)
         re->window_use(re->software.ob);
         gl_context = re->window_gl_context_get(re->software.ob);
         gim->tex = evas_gl_common_texture_new(gl_context, gim->im, EINA_FALSE);
+        EINA_SAFETY_ON_NULL_RETURN(gim->tex);
+        gim->tex->im = gim;
         im->cache_entry.flags.updated_data = 1;
      }
    evas_gl_preload_target_register(gim->tex, (Eo*) target);