}
else
{
- E_Client *ec;
- E_Comp_Wl_Client_Data *cdata;
+ E_Surface *surface;
- ec = hwc_window->ec;
- if (!ec) return;
- cdata = e_client_cdata_get(ec);
- if (!cdata) return;
+ if (!hwc_window->ec)
+ return;
+
+ surface = e_surface_try_from_ec(hwc_window->ec);
+ if (!surface)
+ return;
- container = &cdata->presentation_container;
+ container = e_surface_presentation_time_container_get(surface);
}
if (!container) return;
Eina_Bool fence_enabled;
E_Hwc_Window_Queue_Type queue_type;
E_Client *ec;
- E_Comp_Wl_Client_Data *cdata;
+ E_Surface *surface;
target_hwc_window = wl_container_of(listener, target_hwc_window, canvas_render_flush_post_listener);
continue;
}
- cdata = e_client_cdata_get(ec);
- if (cdata)
+ surface = e_surface_try_from_ec(ec);
+ if (surface)
e_presentation_time_container_feedback_merge(&comp_info->presentation_container,
- &cdata->presentation_container);
+ e_surface_presentation_time_container_get(surface));
buffer = e_pixmap_ref_resource_get(ec->pixmap);
if (!buffer)
E_Hwc_Windows_Comp_Info *pp_comp_info, *comp_info;
tdm_error terror = TDM_ERROR_NONE;
E_Client *ec;
- E_Comp_Wl_Client_Data *cdata;
+ E_Surface *surface;
EINA_SAFETY_ON_NULL_RETURN_VAL(hwc, EINA_FALSE);
if (hwc->pp_hwc_window)
{
ec = hwc->pp_hwc_window->ec;
- cdata = e_client_cdata_get(ec);
- if (ec && cdata)
+ if (ec && (surface = e_surface_try_from_ec(ec)))
e_presentation_time_container_feedback_merge(&pp_comp_info->presentation_container,
- &cdata->presentation_container);
+ e_surface_presentation_time_container_get(surface));
e_hwc_presentation_callback_list_merge(&pp_comp_info->presentation_callbacks,
&hwc->pp_hwc_window->pending_presentation_callbacks);
surface->pending.committed |= E_SURFACE_STATE_PRESENTATION_TIME_FEEDBACK;
}
+EINTERN E_Presentation_Time_Container *
+e_surface_presentation_time_container_get(E_Surface *surface)
+{
+ return &surface->current.presentation_container;
+}
+
EINTERN void
e_surface_ec_set(E_Surface *surface, E_Client *ec)
{
surface->base.sub.list_changed |= reordered;
}
-static void
-_e_surface_pending_presentation_time_feedback_update(E_Surface *surface)
-{
- e_presentation_time_container_feedback_discard(&surface->base.presentation_container);
- e_presentation_time_container_feedback_merge(&surface->base.presentation_container, &surface->current.presentation_container);
-}
-
static void
_e_surface_pending_update(E_Surface *surface)
{
E_Surface *root_surface;
struct ds_surface *ds_surface = surface->ds_surface;
- if (surface->current.committed & E_SURFACE_STATE_PRESENTATION_TIME_FEEDBACK)
- _e_surface_pending_presentation_time_feedback_update(surface);
-
if (ds_surface->current.committed & DS_SURFACE_STATE_BUFFER)
_e_surface_pending_buffer_update(surface);
pixman_region32_t *e_surface_input_region_get(E_Surface *surface);
uint32_t e_surface_exported_id_get(E_Surface *surface);
struct wl_resource *e_surface_resource_get(E_Surface *surface);
+
+/**
+ * Add an E_Presentation_Time_Feedback instance to the pending state of a given surface
+ *
+ * The pending state will be applied during the next commit.
+ */
void e_surface_presentation_time_feedback_add(E_Surface *surface, E_Presentation_Time_Feedback *feedback);
+/**
+ * Get an E_Presentation_Time_Container instance from a given surface
+ *
+ * This function returns an E_Presentation_Time_Contaner from the current state
+ * of the given surface. The return value is guaranteed to be non-null, ensuring
+ * that a valid container object is always provided.
+ */
+E_Presentation_Time_Container *e_surface_presentation_time_container_get(E_Surface *surface);
+
/**
* Return actual buffer area to be referenced based on surface's buffer
* transform and source region of viewport.
if (!only_free)
{
+ surface = e_surface_try_from_ec(ec);
+
/* release the helded buffer by e_client */
if (ec->comp_data)
{
/* release the helded buffer by e_client */
e_comp_wl_buffer_reference(&ec->comp_data->buffer_ref, NULL);
- e_presentation_time_container_feedback_discard(&ec->comp_data->presentation_container);
+
+ if (surface)
+ e_presentation_time_container_feedback_discard(e_surface_presentation_time_container_get(surface));
}
/* composite object clear */
e_view_client_clear(e_client_view_get(ec));
- surface = e_surface_try_from_ec(ec);
if (!surface) return;
e_surface_frame_done_send(surface);
E_Comp_Wl_Surface_State pending;
EINA_DEPRECATED Eina_List *frames;
- E_Presentation_Time_Container presentation_container;
+ E_DEPRECATED E_Presentation_Time_Container presentation_container;
struct
{