hermet pushed a commit to branch master.

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

commit bb984b566bd1f12f9c5df8ba7436dbb1151ea363
Author: Hermet Park <[email protected]>
Date:   Wed Aug 8 16:01:11 2018 +0900

    evas image: fix screen flickering issue at partial + image preloading
    
    Summary:
    Prerequisite: Partial rendering ON + Image Prealoding + Triple surface 
buffer of GL.
    
    Previously, evas trys to draw of an image which didn't prepare of image 
data yet (in case of preloading)
    This time, it will draw a solid color onto the dest sufrace 1,
    But luckily, preloading is finished just after, it draws proper image data 
onto next surface 2 and 3.
    
    Now, triple buffer is filled with the image data but only first frame is 
still empty. That's a problem.
    
    This patch skips to draw image if it doesn't prepare data yet, but once the 
preloading is finished,
    it starts to draw images.
    
    @fix
    
    Reviewers: #committers
    
    Subscribers: kimcinoo, cedric, #committers, zmike
    
    Tags: #efl
    
    Differential Revision: https://phab.enlightenment.org/D6739
---
 src/lib/evas/canvas/evas_image_private.h |  3 ++-
 src/lib/evas/canvas/evas_object_image.c  | 13 +++++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/src/lib/evas/canvas/evas_image_private.h 
b/src/lib/evas/canvas/evas_image_private.h
index 91f5948a70..915e81eb45 100644
--- a/src/lib/evas/canvas/evas_image_private.h
+++ b/src/lib/evas/canvas/evas_image_private.h
@@ -125,7 +125,8 @@ struct _Evas_Image_Data
    Eina_Bool         filled : 1;
    Eina_Bool         filled_set : 1;
    Eina_Bool         proxyrendering : 1;
-   Eina_Bool         preloading : 1;
+   Eina_Bool         preloading : 1;      //on preloading
+   Eina_Bool         preloaded: 1;        //just finsihed preloading
    Eina_Bool         video_surface : 1;
    Eina_Bool         video_visible : 1;
    Eina_Bool         created : 1;
diff --git a/src/lib/evas/canvas/evas_object_image.c 
b/src/lib/evas/canvas/evas_object_image.c
index 22c1c7d99c..aecff55ca6 100644
--- a/src/lib/evas/canvas/evas_object_image.c
+++ b/src/lib/evas/canvas/evas_object_image.c
@@ -1236,7 +1236,10 @@ _evas_image_load_post_update(Evas_Object *eo_obj, 
Evas_Object_Protected_Data *ob
            state_write->image.stride = stride;
         }
         EINA_COW_IMAGE_STATE_WRITE_END(o, state_write);
+        o->changed = EINA_TRUE;
+        o->preloaded = EINA_TRUE;
         if (resize_call) evas_object_inform_call_image_resize(eo_obj);
+        evas_object_change(eo_obj, obj);
      }
    else
      {
@@ -2251,6 +2254,9 @@ evas_object_image_render_pre(Evas_Object *eo_obj,
    int is_v = 0, was_v = 0;
    Eina_Bool changed_prep = EINA_TRUE;
 
+   /* image is not ready yet, skip rendering. Leave it to next frame */
+   if (o->preloading) return;
+
    /* dont pre-render the obj twice! */
    if (obj->pre_render_done) return;
    obj->pre_render_done = EINA_TRUE;
@@ -2379,6 +2385,13 @@ evas_object_image_render_pre(Evas_Object *eo_obj,
              evas_object_render_pre_prev_cur_add(&e->clip_changes, eo_obj, 
obj);
              goto done;
           }
+        //pre-loading is finished
+        if (o->preloaded)
+          {
+             evas_object_render_pre_prev_cur_add(&e->clip_changes, eo_obj, 
obj);
+             o->preloaded = EINA_FALSE;
+             goto done;
+          }
      }
    if (((obj->cur->geometry.x != obj->prev->geometry.x) ||
         (obj->cur->geometry.y != obj->prev->geometry.y) ||

-- 


Reply via email to