e_hwc_window_queue: don't destory the queue for the target_window 18/195618/2
authorSooChan Lim <sc1.lim@samsung.com>
Sun, 16 Dec 2018 07:50:24 +0000 (16:50 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Sun, 16 Dec 2018 07:59:35 +0000 (07:59 +0000)
Change-Id: I73253e4171e11907892e829a63f82b699a719ab3

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

index 48a4692..e9c09a8 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 c9b9170..be18a59 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