video: Change to idle_enterer from ecore_job 25/257525/1
authorSeunghun Lee <shiin.lee@samsung.com>
Tue, 27 Apr 2021 04:18:43 +0000 (13:18 +0900)
committerSeunghun Lee <shiin.lee@samsung.com>
Tue, 27 Apr 2021 07:18:44 +0000 (16:18 +0900)
This patch changes video to use idle_enterer from ecore_job.

If geometry of a video changes by animating run by ecore_animator or so,
then the video cannot have chance to work before the hwc output.
Consequently, all changes with the video missing gets applied to the
output.

The occurrence order of each handler was as follow:
job(video) -> animator(animating) -> idle_enterer(hwc output)

The changed order is as follow:
animator(animating) -> idle_enterer(video) -> idle_enterer(hwc_output)

Change-Id: I558178883efcb68d6b2fb6ef8c138aea99b6eaae

src/bin/video/iface/e_video_hwc.c
src/bin/video/iface/e_video_hwc.h

index 9e559f87697bbd87625935447471e9f951d98a64..4aaf7bbe71ec95e5ffb14825fcf437c608070707 100644 (file)
@@ -1160,8 +1160,8 @@ _e_video_hwc_geometry_map_apply(E_Client *ec, E_Video_Hwc_Geometry *out)
    return EINA_TRUE;
 }
 
-static void
-_e_video_hwc_render_job(void *data)
+static Eina_Bool
+_e_video_hwc_idle_enterer(void *data)
 {
    E_Video_Hwc *evh;
    E_Client *topmost;
@@ -1169,10 +1169,9 @@ _e_video_hwc_render_job(void *data)
    Eina_Bool render_fail = EINA_FALSE;
 
    evh = data;
-   evh->render.job = NULL;
 
    if (e_object_is_del(E_OBJECT(evh->ec)))
-     return;
+     goto end;
 
    if (evh->render.map)
      {
@@ -1207,15 +1206,26 @@ _e_video_hwc_render_job(void *data)
              evh->backend.destroy(evh);
           }
      }
+
+end:
+   /* The idle enterer will get deleted as a result of returning
+    * ECORE_CALLBACK_CANCEL. */
+   evh->render.idle_enterer = NULL;
+
+   return ECORE_CALLBACK_CANCEL;
 }
 
 static void
 _e_video_hwc_render_queue(E_Video_Hwc *evh)
 {
-   if (evh->render.job)
-     ecore_job_del(evh->render.job);
+   if (evh->render.idle_enterer)
+     return;
 
-   evh->render.job = ecore_job_add(_e_video_hwc_render_job, evh);
+   /* The reason that ecore_idle_enterer_*before*_add is used here is to give
+    * a chance to deal with its jobs prior to the hwc output dealing with its
+    * job with idle entererer as well. */
+   evh->render.idle_enterer =
+      ecore_idle_enterer_before_add(_e_video_hwc_idle_enterer, evh);
 }
 
 static void
@@ -1830,7 +1840,7 @@ _e_video_hwc_iface_destroy(E_Video_Comp_Iface *iface)
 
    _e_video_hwc_client_event_deinit(evh);
 
-   E_FREE_FUNC(evh->render.job, ecore_job_del);
+   E_FREE_FUNC(evh->render.idle_enterer, ecore_idle_enterer_del);
 
    if (evh->render_fail.walking)
      {
index 6a443c1e81ae66f237a5ae006a292933c338fbdd..0e6e9a21874ada7d3fe920a1ec8c9eea00d6cf8d 100644 (file)
@@ -96,7 +96,7 @@ struct _E_Video_Hwc
 
    struct
      {
-        Ecore_Job *job;
+        Ecore_Idle_Enterer *idle_enterer;
         Eina_Bool map;
         Eina_Bool redraw;
         Eina_Bool topmost_viewport;