static void
_e_hwc_windows_target_window_free(E_Hwc_Window_Target *target_hwc_window)
{
- E_Hwc_Window *target_window = (E_Hwc_Window *)target_hwc_window;
+ E_Hwc_Window *hwc_window = (E_Hwc_Window *)target_hwc_window;
if (target_hwc_window->evas)
{
if (target_hwc_window->event_fd >= 0)
close(target_hwc_window->event_fd);
- if (target_window->queue && target_window->queue->tqueue)
- tbm_surface_queue_destroy(target_window->queue->tqueue);
+ if (hwc_window->queue && hwc_window->queue->tqueue)
+ tbm_surface_queue_destroy(hwc_window->queue->tqueue);
+
+ e_presentation_time_container_finish(&hwc_window->presentation_container);
+ e_hwc_presentation_callback_list_finish(&hwc_window->pending_presentation_callbacks);
+ e_hwc_presentation_callback_list_finish(&hwc_window->presentation_callbacks);
+
+ if (hwc_window->queue_destroy_listener.notify)
+ {
+ wl_list_remove(&hwc_window->queue_destroy_listener.link);
+ hwc_window->queue_destroy_listener.notify = NULL;
+ }
+
+ e_hwc_window_queue_buffer_reference(&hwc_window->current.queue_buffer_ref, NULL);
+ e_hwc_window_queue_buffer_reference(&hwc_window->commit.queue_buffer_ref, NULL);
+ e_hwc_window_queue_buffer_reference(&hwc_window->display.queue_buffer_ref, NULL);
+
+ e_hwc_window_buffer_set(&hwc_window->current.buffer, NULL, NULL, 0);
+ e_hwc_window_buffer_set(&hwc_window->commit.buffer, NULL, NULL, 0);
+ e_hwc_window_buffer_set(&hwc_window->display.buffer, NULL, NULL, 0);
EHWSINF("Free target window", NULL, NULL);
e_hwc_windows_target_window_new(E_Hwc *hwc, Eina_Bool is_root_target)
{
E_Hwc_Window_Target *target_hwc_window;
+ E_Hwc_Window *hwc_window;
EINA_SAFETY_ON_NULL_RETURN_VAL(hwc, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(hwc->thwc, NULL);
target_hwc_window = E_OBJECT_ALLOC(E_Hwc_Window_Target, E_HWC_WINDOW_TYPE, _e_hwc_windows_target_window_free);
EINA_SAFETY_ON_NULL_GOTO(target_hwc_window, fail);
- ((E_Hwc_Window *)target_hwc_window)->is_root_target = is_root_target;
- ((E_Hwc_Window *)target_hwc_window)->is_target = EINA_TRUE;
- ((E_Hwc_Window *)target_hwc_window)->state = E_HWC_WINDOW_STATE_DEVICE;
- ((E_Hwc_Window *)target_hwc_window)->accepted_state = E_HWC_WINDOW_STATE_DEVICE;
- ((E_Hwc_Window *)target_hwc_window)->hwc = hwc;
+ hwc_window = (E_Hwc_Window *)target_hwc_window;
+
+ hwc_window->is_root_target = is_root_target;
+ hwc_window->is_target = EINA_TRUE;
+ hwc_window->state = E_HWC_WINDOW_STATE_DEVICE;
+ hwc_window->accepted_state = E_HWC_WINDOW_STATE_DEVICE;
+ hwc_window->hwc = hwc;
+
+ e_presentation_time_container_init(&hwc_window->presentation_container);
+ e_hwc_presentation_callback_list_init(&hwc_window->pending_presentation_callbacks);
+ e_hwc_presentation_callback_list_init(&hwc_window->presentation_callbacks);
target_hwc_window->hwc = hwc;
target_hwc_window->event_fd = -1;