ecore_evas: don't unset animator_ran in idle_exiter to prevent the render freeze.
authorGwanglim Lee <gl77.lee@samsung.com>
Fri, 1 Dec 2017 03:10:21 +0000 (12:10 +0900)
committerJiyoun Park <jy0703.park@samsung.com>
Thu, 21 Dec 2017 11:33:39 +0000 (20:33 +0900)
You could meet render freeze if you use the evas wayland_egl engine.
Because ee's animator could be ticked by the wl_frame done callback of
the ecore_wl2 even while ee is in the idle time.

Thus we should not unset the animator_ran value of the ee if ee's animator
is ticked while idle time.

Change-Id: I73bb2782638b67446d358b0e81238ae6d58d60e6

src/lib/ecore_evas/ecore_evas.c
src/lib/ecore_evas/ecore_evas_private.h

index 9b7afb4..9395c84 100644 (file)
@@ -75,6 +75,10 @@ static const Efl_Event_Description *_event_description_get(Efl_Pointer_Action ac
 //RENDER_SYNC
 static int _ecore_evas_render_sync = 1;
 
+// TIZEN_ONLY(20171130) to prevent the render freeze
+static Eina_Bool _ee_idle_enter = EINA_FALSE;
+// End of TIZEN_ONLY(20171130)
+
 static void
 _ecore_evas_focus_out_dispatch(Ecore_Evas *ee, Efl_Input_Device *seat)
 {
@@ -137,8 +141,21 @@ _ecore_evas_idle_exiter(void *data EINA_UNUSED)
 {
    Ecore_Evas *ee;
 
+   // TIZEN_ONLY(20171130) to prevent the render freeze
+   _ee_idle_enter = EINA_FALSE;
+   // End of TIZEN_ONLY(20171130)
+
    EINA_INLIST_FOREACH(ecore_evases, ee)
-     ee->animator_ran = EINA_FALSE;
+     {
+        // TIZEN_ONLY(20171130) to prevent the render freeze
+        if (ee->animator_ticked_in_idler)
+          {
+             continue;
+          }
+        // End of TIZEN_ONLY(20171130)
+
+        ee->animator_ran = EINA_FALSE;
+     }
 
    return ECORE_CALLBACK_RENEW;
 }
@@ -210,6 +227,10 @@ _ecore_evas_idle_enter(void *data EINA_UNUSED)
    double now = ecore_loop_time_get();
 #endif
 
+   // TIZEN_ONLY(20171130) to prevent the render freeze
+   _ee_idle_enter = EINA_TRUE;
+   // End of TIZEN_ONLY(20171130)
+
    if (!ecore_evases) return ECORE_CALLBACK_RENEW;
 
    if (_ecore_evas_fps_debug)
@@ -218,6 +239,10 @@ _ecore_evas_idle_enter(void *data EINA_UNUSED)
      }
    EINA_INLIST_FOREACH(ecore_evases, ee)
      {
+        // TIZEN_ONLY(20171130) to prevent the render freeze
+        ee->animator_ticked_in_idler = 0;
+        // End of TIZEN_ONLY(20171130)
+
         if (ee->manual_render)
           {
              if (ee->engine.func->fn_evas_changed)
@@ -3203,6 +3228,11 @@ ecore_evas_animator_tick(Ecore_Evas *ee, Eina_Rectangle *viewport, double loop_t
 
    ecore_loop_time_set(loop_time);
 
+   // TIZEN_ONLY(20171130) to prevent the render freeze
+   if (_ee_idle_enter)
+     ee->animator_ticked_in_idler = 1;
+   // End of TIZEN_ONLY(20171130)
+
    ee->animator_ran = EINA_TRUE;
    efl_event_callback_call(ee->evas, EFL_EVENT_ANIMATOR_TICK, &a);
 
index 00185d0..694d136 100644 (file)
@@ -392,6 +392,10 @@ struct _Ecore_Evas
    Eina_Bool keyboard_state : 1;
    Eina_Bool clipboard_state : 1;
    //
+
+   // TIZEN_ONLY(20171130) to prevent the render freeze
+   unsigned char animator_ticked_in_idler : 1;
+   // End of TIZEN_ONLY(20171130)
 };
 
 struct _Ecore_Evas_Aux_Hint