{
E_Hwc_Window_Target *target_hwc_window;
E_Hwc_Window *hwc_window;
- E_Hwc_Windows_Comp_Info *comp_info;
tdm_hwc *thwc;
tdm_region fb_damage;
hwc_window = (E_Hwc_Window *)hwc->root_target_hwc_window;
if (hwc_window->current.buffer.tsurface)
- {
- comp_info = _e_hwc_windows_comp_info_get(hwc_window->current.buffer.tsurface);
- if (comp_info)
- {
- e_hwc_window_presentation_time_feedback_take((E_Hwc_Window *)target_hwc_window,
- &comp_info->presentation_container);
- e_hwc_window_presentation_callback_take((E_Hwc_Window *)target_hwc_window,
- &comp_info->presentation_callbacks);
- }
- }
+ e_hwc_windows_presentation_time_feedback_and_callback_take(hwc, hwc_window->current.buffer.tsurface);
e_hwc_window_queue_buffer_reference(&hwc_window->current.queue_buffer_ref, hwc_window->display.queue_buffer_ref.buffer);
e_hwc_window_buffer_set(&hwc_window->current.buffer, hwc_window->display.buffer.tsurface,
return EINA_TRUE;
}
+static void
+_e_hwc_windows_target_window_queue_clear(E_Hwc_Window_Target *target_hwc_window)
+{
+ E_Hwc_Window *hwc_window;
+ E_Hwc_Window_Queue_Buffer *queue_buffer;
+
+ hwc_window = (E_Hwc_Window *)target_hwc_window;
+
+ while ((queue_buffer = e_hwc_window_queue_buffer_acquire(hwc_window->queue)))
+ {
+ e_hwc_windows_presentation_time_feedback_and_callback_take(target_hwc_window->hwc, queue_buffer->tsurface);
+ e_hwc_window_queue_buffer_release(hwc_window->queue, queue_buffer);
+ }
+}
+
static Eina_Bool
_e_hwc_windows_root_target_buffer_fetch(E_Hwc *hwc)
{
comp_info = _e_hwc_windows_comp_info_get(tsurface);
if ((comp_info) && (comp_info->skip))
{
- e_hwc_window_presentation_time_feedback_take((E_Hwc_Window *)hwc->target_hwc_window,
- &comp_info->presentation_container);
- e_hwc_window_presentation_callback_take((E_Hwc_Window *)hwc->target_hwc_window,
- &comp_info->presentation_callbacks);
+ e_hwc_windows_presentation_time_feedback_and_callback_take(hwc, tsurface);
e_hwc_window_queue_buffer_release(queue, queue_buffer);
return EINA_FALSE;
}
}
else
{
- e_hwc_window_queue_clear(queue);
+ _e_hwc_windows_target_window_queue_clear(target_hwc_window);
if (!hwc_window->current.buffer.tsurface) return EINA_FALSE;
{
queue_buffer = e_hwc_window_queue_buffer_find(hwc_window->current.buffer.queue, hwc_window->current.buffer.tsurface);
if (queue_buffer)
- {
- E_Hwc_Windows_Comp_Info *comp_info;
-
- comp_info = _e_hwc_windows_comp_info_get(hwc_window->current.buffer.tsurface);
- if (comp_info)
- {
- e_hwc_window_presentation_time_feedback_take((E_Hwc_Window *)hwc->target_hwc_window,
- &comp_info->presentation_container);
- e_hwc_window_presentation_callback_take((E_Hwc_Window *)hwc->target_hwc_window,
- &comp_info->presentation_callbacks);
- }
- }
+ e_hwc_windows_presentation_time_feedback_and_callback_take(hwc, hwc_window->current.buffer.tsurface);
}
e_hwc_window_queue_buffer_reference(&hwc_window->current.queue_buffer_ref, NULL);
comp_info->skip = EINA_TRUE;
}
- e_hwc_window_queue_clear(((E_Hwc_Window *)root_target_hwc_window)->queue);
+ _e_hwc_windows_target_window_queue_clear(root_target_hwc_window);
_e_hwc_windows_target_window_buffer_skip(hwc);
return EINA_TRUE;
}
+
+EINTERN void
+e_hwc_windows_presentation_time_feedback_and_callback_take(E_Hwc *hwc, tbm_surface_h tsurface)
+{
+ E_Hwc_Windows_Comp_Info *comp_info;
+ E_Hwc_Window_Target *target_hwc_window;
+
+ EINA_SAFETY_ON_NULL_RETURN(hwc);
+ EINA_SAFETY_ON_NULL_RETURN(tsurface);
+
+ target_hwc_window = hwc->target_hwc_window;
+ EINA_SAFETY_ON_NULL_RETURN(target_hwc_window);
+
+ comp_info = _e_hwc_windows_comp_info_get(tsurface);
+ if (comp_info)
+ {
+ e_hwc_window_presentation_time_feedback_take((E_Hwc_Window *)target_hwc_window,
+ &comp_info->presentation_container);
+ e_hwc_window_presentation_callback_take((E_Hwc_Window *)target_hwc_window,
+ &comp_info->presentation_callbacks);
+ }
+}