evas: allow to suspend the rendering of an output.
authorCedric BAIL <cedric@osg.samsung.com>
Thu, 26 Oct 2017 20:35:27 +0000 (13:35 -0700)
committerCedric BAIL <cedric@osg.samsung.com>
Thu, 26 Oct 2017 20:35:27 +0000 (13:35 -0700)
src/lib/evas/canvas/evas_out.c
src/lib/evas/canvas/evas_render.c
src/lib/evas/include/evas_private.h

index cd7fbaf..34e2933 100644 (file)
@@ -172,13 +172,14 @@ efl_canvas_output_engine_info_get(Efl_Canvas_Output *output)
 }
 
 EAPI Eina_Bool
-efl_canvas_output_lock(Efl_Canvas_Output *output EINA_UNUSED)
+efl_canvas_output_lock(Efl_Canvas_Output *output)
 {
-   return EINA_FALSE;
+   output->lock++;
+   return EINA_TRUE;
 }
 
 EAPI Eina_Bool
 efl_canvas_output_unlock(Efl_Canvas_Output *output EINA_UNUSED)
 {
-   return EINA_FALSE;
+   return !!(--output->lock);
 }
index 3f1895d..9e6a658 100644 (file)
@@ -3319,6 +3319,9 @@ evas_render_updates_internal(Evas *eo_e,
      {
         // Avoid processing not ready output until they are
         if (!out->output) continue ;
+        // Locked output are output that should not yet be rendered
+        // because the tick/vsync for it doesn't allow it yet.
+        if (out->lock > 0) continue ;
 
         /* phase 6. Initialize output */
         if (out->changed)
index bc7c1f9..8a16d63 100644 (file)
@@ -1336,6 +1336,8 @@ struct _Efl_Canvas_Output
 
    int info_magic;
 
+   unsigned short lock;
+
    Eina_Bool changed : 1;
 };