From e86b8c67be5ce425546b02c3beb15ef7e691b61f Mon Sep 17 00:00:00 2001 From: Changyeon Lee Date: Mon, 2 Mar 2020 16:58:10 +0900 Subject: [PATCH] e_hwc_windows: check transition of client to none when display state is changed 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 | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/bin/e_hwc_windows.c b/src/bin/e_hwc_windows.c index 3a549925a5..efd2c03dc1 100644 --- a/src/bin/e_hwc_windows.c +++ b/src/bin/e_hwc_windows.c @@ -1919,6 +1919,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); @@ -1945,6 +1947,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) && @@ -1952,6 +1956,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) && @@ -1959,6 +1965,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) && @@ -1966,6 +1974,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) && @@ -1973,6 +1983,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) && @@ -1980,6 +1992,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) && @@ -1987,6 +2001,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) && @@ -1994,6 +2010,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) @@ -2001,10 +2026,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; } -- 2.34.1