e_hwc_window: change the constraints api. 41/190741/4
authorSooChan Lim <sc1.lim@samsung.com>
Fri, 5 Oct 2018 01:38:35 +0000 (10:38 +0900)
committerSeunghun Lee <shiin.lee@samsung.com>
Tue, 30 Oct 2018 05:43:46 +0000 (05:43 +0000)
change the e_hwc_window_constraints_set to
e_hwc_window_constraints_update

Change-Id: I0e37efef39724e34b3b16014d64550c971bbc3ba

src/bin/e_hwc_window.c
src/bin/e_hwc_window.h
src/bin/e_hwc_windows.c

index 64ebce022625d067b6ea910c4a90897c95a91ca5..2667f2d36b54a8812af21622bfad3d41542a0e8e 100644 (file)
@@ -466,6 +466,18 @@ _e_hwc_window_target_window_get(E_Hwc_Window *hwc_window)
    return target_hwc_window;
 }
 
+static void
+_e_hwc_window_constraints_reset(E_Hwc_Window *hwc_window)
+{
+   /* reset the TDM_CONSTRAINT_BUFFER_QUEUE */
+   if (hwc_window->queue)
+     {
+        e_hwc_window_queue_user_unset(hwc_window->queue, hwc_window);
+        wl_list_remove(&hwc_window->queue_destroy_listener.link);
+        hwc_window->queue = NULL;
+     }
+}
+
 static void
 _e_hwc_window_client_cb_new(void *data EINA_UNUSED, E_Client *ec)
 {
@@ -517,10 +529,10 @@ _e_hwc_window_client_cb_del(void *data EINA_UNUSED, E_Client *ec)
    if (e_hwc_policy_get(output->hwc) == E_HWC_POLICY_PLANES)
      return;
 
-   e_hwc_window_constraints_set(ec->hwc_window, TDM_CONSTRAINT_NONE);
-
    if (!ec->hwc_window) return;
 
+   _e_hwc_window_constraints_reset(ec->hwc_window);
+
    e_hwc_window_free(ec->hwc_window);
    ec->hwc_window = NULL;
 }
@@ -1758,11 +1770,18 @@ e_hwc_window_is_on_target_window(E_Hwc_Window *hwc_window)
 }
 
 EINTERN Eina_Bool
-e_hwc_window_constraints_set(E_Hwc_Window *hwc_window, int constraints)
+e_hwc_window_constraints_update(E_Hwc_Window *hwc_window)
 {
    E_Hwc_Window_Queue *queue = NULL;
+   tdm_error terror;
+   int constraints;
 
    EINA_SAFETY_ON_FALSE_RETURN_VAL(hwc_window, EINA_FALSE);
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(hwc_window->thwc_window, EINA_FALSE);
+
+   /* get the constraints from libtdm */
+   terror = tdm_hwc_window_get_constraints(hwc_window->thwc_window, &constraints);
+   EINA_SAFETY_ON_TRUE_RETURN_VAL(terror != TDM_ERROR_NONE, EINA_FALSE);
 
    if (hwc_window->constraints == constraints) return EINA_TRUE;
 
@@ -1785,12 +1804,7 @@ e_hwc_window_constraints_set(E_Hwc_Window *hwc_window, int constraints)
      }
    else
      {
-         if (hwc_window->queue)
-           {
-              e_hwc_window_queue_user_unset(hwc_window->queue, hwc_window);
-              wl_list_remove(&hwc_window->queue_destroy_listener.link);
-              hwc_window->queue = NULL;
-           }
+         _e_hwc_window_constraints_reset(hwc_window);
      }
 
    hwc_window->constraints = constraints;
index 21decef1f141c022d641858d6c3c3cef920d3ae8..c587c192f14c68aecfb4c0f4cf550ddfba85cf11 100644 (file)
@@ -171,7 +171,7 @@ EINTERN E_Hwc_Window_State e_hwc_window_state_get(E_Hwc_Window *hwc_window);
 EINTERN Eina_Bool          e_hwc_window_accepted_state_set(E_Hwc_Window *hwc_window, E_Hwc_Window_State state);
 EINTERN E_Hwc_Window_State e_hwc_window_accepted_state_get(E_Hwc_Window *hwc_window);
 
-EINTERN Eina_Bool          e_hwc_window_constraints_set(E_Hwc_Window *hwc_window, int constraints);
+EINTERN Eina_Bool          e_hwc_window_constraints_update(E_Hwc_Window *hwc_window);
 
 EINTERN void               e_hwc_window_render_list_add(E_Hwc_Window *hwc_window);
 EINTERN Eina_Bool          e_hwc_window_is_on_target_window(E_Hwc_Window *hwc_window);
index 1bbe384580571641bbe7e683c65ee7d6c7e8899a..a16079a676d4307d0b90462a87328c9090c35db9 100644 (file)
@@ -986,20 +986,14 @@ _e_hwc_windows_transition_check(E_Hwc *hwc)
 static void
 _e_hwc_windows_constraints_update(E_Hwc *hwc)
 {
-   tdm_error terror;
    E_Hwc_Window *hwc_window;
    const Eina_List *l;
-   int constraints;
 
    EINA_LIST_FOREACH(hwc->hwc_windows, l, hwc_window)
      {
         if (hwc_window->is_target) continue;
-        if (!hwc_window->thwc_window) continue;
-
-        terror = tdm_hwc_window_get_constraints(hwc_window->thwc_window, &constraints);
-        if (terror != TDM_ERROR_NONE) continue;
 
-        e_hwc_window_constraints_set(hwc_window, constraints);
+        e_hwc_window_constraints_update(hwc_window);
      }
 
    return;