e_comp_wl: Deprecate presentation_container 83/325383/1
authorSeunghun Lee <shiin.lee@samsung.com>
Wed, 21 May 2025 04:09:08 +0000 (13:09 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Tue, 10 Jun 2025 02:33:43 +0000 (11:33 +0900)
The presentation_container is now replaced with
e_surface_presentation_container_get().

Change-Id: I9afe654680cb5978f9b0311f13e4703db65a0615

src/bin/displaymgr/e_hwc_windows.c
src/bin/server/e_compositor.c
src/bin/server/e_compositor_intern.h
src/bin/windowmgr/e_policy.c
src/include/e_comp_wl.h

index 579d5878e9e0dff9b5bddafca918cf8006767e01..25ef152a18e01e038f20f150c9e688c62467beda 100644 (file)
@@ -296,15 +296,16 @@ _e_hwc_windows_presentation_feedback_take(E_Hwc_Window *hwc_window)
      }
    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;
@@ -1449,7 +1450,7 @@ _e_hwc_windows_canvas_cb_render_flush_post(struct wl_listener *listener, void *d
    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);
 
@@ -1514,10 +1515,10 @@ _e_hwc_windows_canvas_cb_render_flush_post(struct wl_listener *listener, void *d
              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)
@@ -2946,7 +2947,7 @@ _e_hwc_windows_pp_commit(E_Hwc *hwc)
    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);
 
@@ -3017,10 +3018,9 @@ _e_hwc_windows_pp_commit(E_Hwc *hwc)
              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);
index a6159fdfb502499217955a7d06316dac8b173483..cc21c09bdc1f95fde3b1a48e363012a11b640c9a 100644 (file)
@@ -623,6 +623,12 @@ e_surface_presentation_time_feedback_add(E_Surface *surface, E_Presentation_Time
    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)
 {
@@ -1376,22 +1382,12 @@ _e_surface_pending_subsurface_order_update(E_Surface *surface)
    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);
 
index 5563ff54d8de9c5337b96e9b89c7d0a69b3e3d56..80a5033f11a439dbe2efa6112f74482957fb7bc3 100644 (file)
@@ -58,8 +58,23 @@ pixman_region32_t *e_surface_opaque_region_get(E_Surface *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.
index b8d000acc84340c0b142bc77b1d08b2b3f88336b..84e1f27b14537202f987eebb29c863896b88fadc 100644 (file)
@@ -1902,18 +1902,21 @@ _e_policy_client_pixmap_buffer_clear(E_Policy_Client *policy_client, Eina_Bool o
 
    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);
index 8a7e6d23ce15a4e113c212fa874a1a197427c2da..d1442ca86ba754932ce481f7b49407a13a0fa1c3 100644 (file)
@@ -427,7 +427,7 @@ struct _E_Comp_Wl_Client_Data
    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
      {