Revert "Revert "e_hwc_window_queue: don't destory the queue for the target_window""
authorSooChan Lim <sc1.lim@samsung.com>
Fri, 28 Dec 2018 06:22:05 +0000 (15:22 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Fri, 12 Apr 2019 10:00:22 +0000 (19:00 +0900)
This reverts commit f0ef32876a6931855f684a93039c2a24a86f7d78.

src/bin/e_hwc_window_queue.c
src/bin/e_hwc_window_queue.h

index 48a4692a790a4986dc44f7e3cf8fb25d043a6aba..e9c09a8a2fe6f62dcda27c51aa87052871a90264 100644 (file)
@@ -704,8 +704,9 @@ _e_hwc_window_queue_unset(E_Hwc_Window_Queue *queue)
      }
    else
      {
-         /* delete the E_Hwc_Window_Queue */
-         _e_hwc_window_queue_destroy(queue);
+         /* if queue is not for target window, delete the E_Hwc_Window_Queue here */
+         if (!queue->is_target)
+           _e_hwc_window_queue_destroy(queue);
      }
 }
 
@@ -808,11 +809,11 @@ _e_hwc_window_queue_cb_accepted_state_change(void *data, E_Hwc_Window *hwc_windo
 static void
 _e_hwc_window_queue_cb_destroy(tbm_surface_queue_h surface_queue, void *data)
 {
-   //TODO: check if the backend delete the tsurface_queue.
-   //      PLEASE Deal with it... if there are pending_users on this queue.
-   //      if the backend deletes the tsurface_queue and
-   //      if there is a pending user at the same equeue(tsurface_queue),
-   //      That means that the backend has the wrong policy at the validation.
+   E_Hwc_Window_Queue *queue = (E_Hwc_Window_Queue *)data;
+
+   if (!queue) return;
+
+   _e_hwc_window_queue_destroy(queue);
 }
 
 static E_Hwc_Window_Queue *
@@ -955,7 +956,10 @@ e_hwc_window_queue_user_set(E_Hwc_Window *hwc_window)
    EINA_SAFETY_ON_NULL_RETURN_VAL(queue, NULL);
 
    if (e_hwc_window_is_target(hwc_window))
-     return queue;
+     {
+        queue->is_target = EINA_TRUE;
+        return queue;
+     }
 
    if (queue->user ||
        queue->state == E_HWC_WINDOW_QUEUE_STATE_UNSET_WAITING)
index c9b9170a591da0302c39005505491230b3583763..be18a59398c5a1ac29300c7bd13fbec9de3ff32e 100644 (file)
@@ -28,6 +28,8 @@ struct _E_Hwc_Window_Queue
    E_Hwc_Window                     *user_waiting_unset;
    Eina_List                        *user_pending_set;
    E_Hwc_Window_Queue_State          state;
+
+   Eina_Bool                         is_target;
 };
 
 struct _E_Hwc_Window_Queue_Buffer