dst_pos.x, dst_pos.y, dst_pos.w, dst_pos.h);
}
-static Eina_Bool
-_e_hwc_windows_presentation_evaluation_check(E_Hwc *hwc)
-{
- E_Hwc_Window_Target *target_hwc_window;
- tbm_surface_h target_tsurface, src_tsurface;
- E_Hwc_Window_Queue *queue;
- E_Hwc_Window_Queue_Buffer *queue_buffer = NULL;
-
- /* copy the presentation_hwc_window to the target_window. */
- target_hwc_window = hwc->target_hwc_window;
- EINA_SAFETY_ON_NULL_RETURN_VAL(target_hwc_window, EINA_FALSE);
-
- queue = ((E_Hwc_Window *)target_hwc_window)->queue;
- EINA_SAFETY_ON_NULL_RETURN_VAL(queue, EINA_FALSE);
-
- src_tsurface = hwc->presentation_hwc_window->current.buffer.tsurface;
- if (!src_tsurface) return EINA_TRUE;
-
- /* dequeue buffer */
- queue_buffer = e_hwc_window_queue_buffer_dequeue(queue);
- EINA_SAFETY_ON_NULL_RETURN_VAL(queue_buffer, EINA_FALSE);
-
- /* copy */
- target_tsurface = queue_buffer->tsurface;
- _e_hwc_windows_sw_copy(hwc, src_tsurface, target_tsurface, E_OUTPUT_DISPLAY_MODE_PRESENTATION);
-
- /* enqueue buffer */
- e_hwc_window_queue_buffer_enqueue(queue, queue_buffer);
-
- /* fetch the buffer */
- _e_hwc_windows_target_buffer_fetch(hwc);
-
- return EINA_TRUE;
-}
-
/* evaluate the hwc_windows */
static Eina_Bool
_e_hwc_windows_evaluate(E_Hwc *hwc, E_Output_Display_Mode display_mode)
_e_hwc_windows_target_state_set(hwc->target_hwc_window, E_HWC_WINDOW_STATE_NONE);
}
- if ((!hwc->primary_output) && (display_mode == E_OUTPUT_DISPLAY_MODE_PRESENTATION))
- _e_hwc_windows_presentation_evaluation_check(hwc);
-
/* skip the target_buffer when the window is on trainsition of the composition */
if ((hwc_mode != E_HWC_MODE_FULL) && (_e_hwc_windows_transition_check(hwc)) && (!hwc->pp_set))
{
return EINA_TRUE;
}
-static Eina_Bool
-_e_hwc_windows_presentation_changes_update(E_Hwc *hwc)
-{
- Eina_Rectangle src_rect = {0, };
- Eina_Rectangle dst_rect = {0, };
- tbm_surface_h tsurface;
-
- EINA_SAFETY_ON_NULL_RETURN_VAL(hwc->presentation_hwc_window, EINA_FALSE);
-
- /* set buffer */
- if (!e_hwc_window_buffer_fetch(hwc->presentation_hwc_window))
- return EINA_FALSE;
-
- e_hwc_window_zpos_set(hwc->presentation_hwc_window, 0);
- e_hwc_window_state_set(hwc->presentation_hwc_window, E_HWC_WINDOW_STATE_DEVICE, EINA_TRUE);
- e_hwc_window_info_update(hwc->presentation_hwc_window);
-
- if (hwc->pp_set)
- {
- tsurface = hwc->presentation_hwc_window->current.buffer.tsurface;
-
- src_rect.x = 0;
- src_rect.y = 0;
- src_rect.w = tbm_surface_get_width(tsurface);
- src_rect.h = tbm_surface_get_height(tsurface);
- dst_rect.x = 0;
- dst_rect.y = 0;
- dst_rect.w = hwc->pp_queue->width;
- dst_rect.h = hwc->pp_queue->height;
- _e_hwc_windows_pp_rect_set(hwc, &src_rect, &dst_rect);
- }
-
- return EINA_TRUE;
-}
-
-static Eina_Bool
-_e_hwc_windows_external_changes_update(E_Hwc *hwc, E_Output_Display_Mode display_mode)
-{
- Eina_Bool update_changes = EINA_FALSE;
-
- if (display_mode == E_OUTPUT_DISPLAY_MODE_MIRROR)
- {
- if (_e_hwc_windows_mirror_changes_update(hwc))
- update_changes = EINA_TRUE;
- }
- else if (display_mode == E_OUTPUT_DISPLAY_MODE_PRESENTATION)
- {
- if (_e_hwc_windows_presentation_changes_update(hwc))
- update_changes = EINA_TRUE;
- }
-
- return update_changes;
-}
-
EINTERN Eina_Bool
e_hwc_windows_init(void)
{
return EINA_TRUE;
}
- if (hwc->primary_output)
+ if (display_mode == E_OUTPUT_DISPLAY_MODE_MIRROR)
{
- if (!_e_hwc_windows_changes_update(hwc))
+ if (!_e_hwc_windows_mirror_changes_update(hwc))
goto update_done;
}
else
{
- if (!_e_hwc_windows_external_changes_update(hwc, display_mode))
+ if (!_e_hwc_windows_changes_update(hwc))
goto update_done;
}
}
EINTERN Eina_Bool
-e_hwc_windows_presentation_update(E_Hwc *hwc, E_Client *ec)
-{
- E_Comp_Wl_Buffer *wl_buffer = NULL;
- tbm_surface_h tsurface = NULL;
- Eina_Rectangle rect = {0, };
- int width = 0;
- int height = 0;
-
- EINA_SAFETY_ON_NULL_RETURN_VAL(hwc, EINA_FALSE);
-
- if (ec)
- {
- if (!hwc->presentation_hwc_window)
- {
- hwc->presentation_hwc_window = e_hwc_window_get(hwc, ec);
- EINA_SAFETY_ON_NULL_RETURN_VAL(hwc->presentation_hwc_window, EINA_FALSE);
-
- e_hwc_window_ref(hwc->presentation_hwc_window);
- e_hwc_window_state_set(hwc->presentation_hwc_window, E_HWC_WINDOW_STATE_DEVICE, EINA_TRUE);
- e_hwc_window_external_set(hwc->presentation_hwc_window, EINA_TRUE);
-
- // TODO: deal with the video
-
- e_output_size_get(hwc->output, &width, &height);
-
- rect.x = 0;
- rect.y = 0;
- rect.w = width;
- rect.h = height;
-
- if (!e_hwc_windows_zoom_set(hwc, &rect))
- {
- EHWSERR("e_hwc_windows_zoom_set failed.", hwc);
- return EINA_FALSE;
- }
- hwc->pp_dst_buffer_clear = EINA_TRUE;
- hwc->pp_hwc_window = hwc->presentation_hwc_window;
- }
-
- /* update the target_buffer */
- wl_buffer = e_pixmap_resource_get(ec->pixmap);
- EINA_SAFETY_ON_NULL_RETURN_VAL(wl_buffer, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(wl_buffer->resource, EINA_FALSE);
-
- tsurface = wayland_tbm_server_get_surface(e_comp->wl_comp_data->tbm.server, wl_buffer->resource);
- EINA_SAFETY_ON_NULL_RETURN_VAL(tsurface, EINA_FALSE);
- }
- else
- {
- if (hwc->presentation_hwc_window)
- {
- e_hwc_window_external_set(hwc->presentation_hwc_window, EINA_FALSE);
- e_hwc_windows_zoom_unset(hwc);
- hwc->pp_hwc_window = NULL;
- hwc->pp_dst_buffer_clear = EINA_FALSE;
- e_hwc_window_unref(hwc->presentation_hwc_window);
- hwc->presentation_hwc_window = NULL;
- }
- }
-
- return EINA_TRUE;
-}
-
-EINTERN Eina_Bool
e_hwc_windows_present_sync(E_Hwc *hwc)
{
E_Hwc_Window_Target *target_hwc_window;