e_hwc_windows: set transition if window has transtion and client state 88/253288/3 accepted/tizen/6.0/unified/20210209.051429 submit/tizen_6.0/20210208.113944
authorChangyeon Lee <cyeon.lee@samsung.com>
Mon, 8 Feb 2021 03:33:03 +0000 (12:33 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Mon, 8 Feb 2021 10:57:08 +0000 (19:57 +0900)
fix flickering this case
1. A window set device state and unredirect
2. target window render frame which doesn't have A window frame
3. A window set client state before hwc state isn't accepted
4. target window commit gl compositing frame, but flickering
   is occurred because 2 step frame doesn't have A Window

Change-Id: I1aac31279c8fdd9ce736a8f597c02d739c5ee4e6

src/bin/e_hwc_windows.c

index 56e75ad0c1080cdde9df11f0faef39df90376a18..aff5f09f25292a35acda028d198e4f21a8914439 100644 (file)
@@ -683,6 +683,69 @@ _e_hwc_windows_target_buffer_fetch(E_Hwc *hwc)
    return EINA_TRUE;
 }
 
+static Eina_Bool
+_e_hwc_windows_target_window_rendered_windows_find(Eina_List *rendered_windows, E_Hwc_Window *hwc_window)
+{
+   E_Hwc_Window *hw;
+   int n_thw;
+   const Eina_List *l;
+
+   if (!rendered_windows) return EINA_FALSE;
+   if (!hwc_window) return EINA_FALSE;
+
+   n_thw = eina_list_count(rendered_windows);
+   if (!n_thw) return EINA_FALSE;
+
+   EINA_LIST_FOREACH(rendered_windows, l, hw)
+     {
+       if (hw == hwc_window)
+         return EINA_TRUE;
+     }
+
+   return EINA_FALSE;
+}
+
+static Eina_Bool
+_e_hwc_windows_target_window_rendered_window_has_no(E_Hwc *hwc, E_Hwc_Window *hwc_window, Eina_Bool all_target)
+{
+   Eina_List *rendered_windows = NULL;
+   E_Hwc_Window_Target *target_hwc_window;
+   E_Hwc_Window *target_window;
+   tbm_surface_h target_tsurface;
+   const Eina_List *l;
+
+   target_hwc_window = hwc->target_hwc_window;
+   EINA_SAFETY_ON_NULL_RETURN_VAL(target_hwc_window, EINA_FALSE);
+
+   target_window = (E_Hwc_Window *)target_hwc_window;
+   if (e_hwc_window_state_get(target_window) != E_HWC_WINDOW_STATE_DEVICE) return EINA_FALSE;
+
+   target_tsurface = target_hwc_window->hwc_window.buffer.tsurface;
+   if (!target_tsurface) return EINA_FALSE;
+
+   if (all_target)
+     {
+        rendered_windows = _e_hwc_windows_target_window_rendered_windows_get(target_tsurface);
+        if (!_e_hwc_windows_target_window_rendered_windows_find(rendered_windows, hwc_window))
+          return EINA_TRUE;
+
+        EINA_LIST_FOREACH(target_hwc_window->rendering_tsurfaces, l, target_tsurface)
+          {
+             rendered_windows = _e_hwc_windows_target_window_rendered_windows_get(target_tsurface);
+             if (!_e_hwc_windows_target_window_rendered_windows_find(rendered_windows, hwc_window))
+               return EINA_TRUE;
+          }
+     }
+   else
+     {
+        rendered_windows = _e_hwc_windows_target_window_rendered_windows_get(target_tsurface);
+        if (!_e_hwc_windows_target_window_rendered_windows_find(rendered_windows, hwc_window))
+          return EINA_TRUE;
+     }
+
+   return EINA_FALSE;
+}
+
 static Eina_Bool
 _e_hwc_windows_target_window_rendered_window_has(E_Hwc *hwc, E_Hwc_Window *hwc_window, Eina_Bool all_target)
 {
@@ -1765,7 +1828,9 @@ _e_hwc_windows_transition_check(E_Hwc *hwc)
         if (e_hwc_window_is_target(hwc_window)) continue;
         if (e_hwc_window_is_video(hwc_window)) continue;
 
-        if (hwc_window->state == hwc_window->accepted_state) continue;
+        if ((hwc_window->state == hwc_window->accepted_state) &&
+            (e_hwc_window_transition_get(hwc_window) == E_HWC_WINDOW_TRANSITION_NONE_TO_NONE))
+          continue;
 
         if (hwc_window->transition_failures > target_hwc_window->max_transition_failures)
           continue;
@@ -1877,6 +1942,12 @@ _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_NONE;
           }
+        else if ((e_hwc_window_transition_get(hwc_window) != E_HWC_WINDOW_TRANSITION_NONE_TO_NONE) &&
+                 (hwc_window->state == E_HWC_WINDOW_STATE_CLIENT))
+          {
+             if (_e_hwc_windows_target_window_rendered_window_has_no(hwc, hwc_window, EINA_TRUE))
+               transition = EINA_TRUE;
+          }
 
         if (window_transition)
           {