e_hwc_windows: check transition of client to none when display state is changed 97/226397/2
authorChangyeon Lee <cyeon.lee@samsung.com>
Mon, 2 Mar 2020 07:58:10 +0000 (16:58 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Mon, 2 Mar 2020 08:52:56 +0000 (17:52 +0900)
consider the case below for prevent flickering
1. 1st window is displayed by HW Plane
   2nd window is displayed by gl compositing
2. gl compositor call rendering of 2nd window but buffer is not enqueued
3. 3rd window is launched and 1st window is hidden
   2st window should be hided
4. buffer of 2 step is enqueued
5. 1nd window is unset by HW Plane because buffer of 2 step doesn't render 1st window
6. 2nd window is shown without 3rd window

Change-Id: I8307901fd70f181c009a548fc96fb34e7b17576f

src/bin/e_hwc_windows.c

index a6066cc7867e870fe0c666110de77d9c96437daf..f6b9d214c68aaa4912c7c51487a2be6f2ae6df0a 100644 (file)
@@ -1792,6 +1792,8 @@ _e_hwc_windows_transition_check(E_Hwc *hwc)
    E_Hwc_Window_Target *target_hwc_window = NULL;
    Eina_Bool transition = EINA_FALSE;
    const Eina_List *l;
+   Eina_Bool display_state_changed = EINA_FALSE;
+   Eina_Bool client_to_none_transition = EINA_FALSE;
 
    target_hwc_window = hwc->target_hwc_window;
    EINA_SAFETY_ON_NULL_RETURN_VAL(target_hwc_window, EINA_FALSE);
@@ -1818,6 +1820,8 @@ _e_hwc_windows_transition_check(E_Hwc *hwc)
           {
              if (!_e_hwc_windows_target_window_rendered_window_has(hwc, hwc_window, EINA_FALSE))
                window_transition = E_HWC_WINDOW_TRANSITION_DEVICE_TO_CLIENT;
+
+             display_state_changed = EINA_TRUE;
           }
         /* DEVICE -> NONE */
         else if ((hwc_window->accepted_state == E_HWC_WINDOW_STATE_DEVICE) &&
@@ -1825,6 +1829,8 @@ _e_hwc_windows_transition_check(E_Hwc *hwc)
           {
              if (_e_hwc_windows_target_window_rendered_window_has(hwc, hwc_window, EINA_TRUE))
                window_transition = E_HWC_WINDOW_TRANSITION_DEVICE_TO_NONE;
+
+             display_state_changed = EINA_TRUE;
           }
         /* CURSOR -> CLIENT */
         else if ((hwc_window->accepted_state == E_HWC_WINDOW_STATE_CURSOR) &&
@@ -1832,6 +1838,8 @@ _e_hwc_windows_transition_check(E_Hwc *hwc)
           {
              if (!_e_hwc_windows_target_window_rendered_window_has(hwc, hwc_window, EINA_FALSE))
                window_transition = E_HWC_WINDOW_TRANSITION_CURSOR_TO_CLIENT;
+
+             display_state_changed = EINA_TRUE;
           }
         /* CURSOR -> NONE */
         else if ((hwc_window->accepted_state == E_HWC_WINDOW_STATE_CURSOR) &&
@@ -1839,6 +1847,8 @@ _e_hwc_windows_transition_check(E_Hwc *hwc)
           {
              if (_e_hwc_windows_target_window_rendered_window_has(hwc, hwc_window, EINA_TRUE))
                window_transition = E_HWC_WINDOW_TRANSITION_CURSOR_TO_NONE;
+
+             display_state_changed = EINA_TRUE;
           }
         /* CLIENT -> DEVICE */
         else if ((hwc_window->accepted_state == E_HWC_WINDOW_STATE_CLIENT) &&
@@ -1846,6 +1856,8 @@ _e_hwc_windows_transition_check(E_Hwc *hwc)
           {
              if (_e_hwc_windows_target_window_rendered_window_has(hwc, hwc_window, EINA_TRUE))
                window_transition = E_HWC_WINDOW_TRANSITION_CLIENT_TO_DEVICE;
+
+             display_state_changed = EINA_TRUE;
           }
         /* CLIENT -> CURSOR */
         else if ((hwc_window->accepted_state == E_HWC_WINDOW_STATE_CLIENT) &&
@@ -1853,6 +1865,8 @@ _e_hwc_windows_transition_check(E_Hwc *hwc)
           {
              if (_e_hwc_windows_target_window_rendered_window_has(hwc, hwc_window, EINA_TRUE))
                window_transition = E_HWC_WINDOW_TRANSITION_CLIENT_TO_CURSOR;
+
+             display_state_changed = EINA_TRUE;
           }
         /* NONE -> DEVICE */
         else if ((hwc_window->accepted_state == E_HWC_WINDOW_STATE_NONE) &&
@@ -1860,6 +1874,8 @@ _e_hwc_windows_transition_check(E_Hwc *hwc)
           {
              if (_e_hwc_windows_target_window_rendered_window_has(hwc, hwc_window, EINA_TRUE))
                window_transition = E_HWC_WINDOW_TRANSITION_NONE_TO_DEVICE;
+
+             display_state_changed = EINA_TRUE;
           }
         /* NONE -> CURSOR */
         else if ((hwc_window->accepted_state == E_HWC_WINDOW_STATE_NONE) &&
@@ -1867,6 +1883,15 @@ _e_hwc_windows_transition_check(E_Hwc *hwc)
           {
              if (_e_hwc_windows_target_window_rendered_window_has(hwc, hwc_window, EINA_TRUE))
                window_transition = E_HWC_WINDOW_TRANSITION_NONE_TO_CURSOR;
+
+             display_state_changed = EINA_TRUE;
+          }
+        /* CLIENT -> NONE */
+        else if ((hwc_window->accepted_state == E_HWC_WINDOW_STATE_CLIENT) &&
+                 (hwc_window->state == E_HWC_WINDOW_STATE_NONE))
+          {
+             if (_e_hwc_windows_target_window_rendered_window_has(hwc, hwc_window, EINA_TRUE))
+               window_transition = E_HWC_WINDOW_TRANSITION_CLIENT_TO_NONE;
           }
 
         if (window_transition)
@@ -1874,10 +1899,20 @@ _e_hwc_windows_transition_check(E_Hwc *hwc)
              hwc_window->transition_failures++;
 
              e_hwc_window_transition_set(hwc_window, window_transition);
+
+             if (window_transition == E_HWC_WINDOW_TRANSITION_CLIENT_TO_NONE)
+               {
+                  client_to_none_transition = EINA_TRUE;
+                  continue;
+               }
+
              transition = EINA_TRUE;
           }
      }
 
+    if ((display_state_changed) && (client_to_none_transition))
+      transition = EINA_TRUE;
+
     return transition;
 }