rotation: added norender pop timer to avoid black screen problem 98/119598/1
authorGwanglim Lee <gl77.lee@samsung.com>
Fri, 17 Mar 2017 12:36:25 +0000 (21:36 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Fri, 17 Mar 2017 12:36:25 +0000 (21:36 +0900)
Change-Id: I11bc656ac5d8990b807cb8814e9d2c7e09287e3e

src/e_mod_effect_rotation.c

index 2aad4a7..0cfbefa 100644 (file)
@@ -53,6 +53,7 @@ typedef struct _Rotation_Effect
    Eina_Bool running;
    Eina_Bool wait_for_buffer;
    Eina_Bool norender;
+   Ecore_Timer *norender_timer;
 } Rotation_Effect;
 
 typedef struct _Rotation_Zone
@@ -669,6 +670,21 @@ _rotation_effect_animator_cb_update(void *data, double pos)
    return ECORE_CALLBACK_RENEW;
 }
 
+static Eina_Bool
+_norender_timer_timeout(void *data)
+{
+   Rotation_Effect *effect = (Rotation_Effect *)data;
+
+   effect->norender_timer = NULL;
+   effect->norender = EINA_FALSE;
+
+   EFFINF("EFF norender pop - timeout", NULL, NULL);
+
+   e_comp_canvas_norender_pop();
+
+   return ECORE_CALLBACK_CANCEL;
+}
+
 static void
 _rotation_effect_start(Rotation_Effect *effect)
 {
@@ -680,8 +696,15 @@ _rotation_effect_start(Rotation_Effect *effect)
     */
    if (effect->norender)
      {
-        e_comp_canvas_norender_pop();
+        if (effect->norender_timer)
+          ecore_timer_del(effect->norender_timer);
+
+        effect->norender_timer = NULL;
         effect->norender = EINA_FALSE;
+
+        EFFINF("EFF norender pop - start", NULL, NULL);
+
+        e_comp_canvas_norender_pop();
      }
 
    EFFINF("Rotation Effect Start", NULL, NULL);
@@ -730,7 +753,17 @@ _rotation_effect_animator_begin_prepare(Rotation_Effect *effect, E_Desk *desk)
     */
    if (!effect->norender)
      {
+        EFFINF("EFF norender push ", NULL, NULL);
+
         e_comp_canvas_norender_push();
+
+        if (effect->norender_timer)
+          ecore_timer_del(effect->norender_timer);
+
+        effect->norender_timer = ecore_timer_add(1.0f,
+                                                 _norender_timer_timeout,
+                                                 effect);
+
         effect->norender = EINA_TRUE;
      }
 }
@@ -844,8 +877,15 @@ _rotation_effect_cb_zone_rotation_cancel(void *data, int type, void *event)
 
    if (effect->norender)
      {
-        e_comp_canvas_norender_pop();
+        if (effect->norender_timer)
+          ecore_timer_del(effect->norender_timer);
+
+        effect->norender_timer = NULL;
         effect->norender = EINA_FALSE;
+
+        EFFINF("EFF norender pop - cancel", NULL, NULL);
+
+        e_comp_canvas_norender_pop();
      }
 
    _rotation_effect_clear(effect);
@@ -953,6 +993,17 @@ _rotation_effect_free(Rotation_Effect *effect)
 {
    if (!effect) return;
 
+   if (effect->norender_timer)
+     ecore_timer_del(effect->norender_timer);
+   effect->norender_timer = NULL;
+   if (effect->norender)
+     {
+        EFFINF("EFF norender pop - free", NULL, NULL);
+
+        e_comp_canvas_norender_pop();
+     }
+   effect->norender = EINA_FALSE;
+
    _rotation_effect_clear(effect);
    evas_object_del(effect->bg);
    E_FREE(effect);