ecore_wl2: Add as partial commit function for setting off a tick
authorDerek Foreman <derekf@osg.samsung.com>
Thu, 5 Oct 2017 19:06:42 +0000 (14:06 -0500)
committerDerek Foreman <derekf@osg.samsung.com>
Thu, 12 Oct 2017 17:24:03 +0000 (12:24 -0500)
This adds the concept of a "false commit" that just sends a surface
commit without changing any other state.

This is intended to be used by ecore_evas to request a frame callback
from the compositor

src/lib/ecore_wl2/Ecore_Wl2.h
src/lib/ecore_wl2/ecore_wl2_window.c

index 70edf4d..1b15e29 100644 (file)
@@ -1892,6 +1892,8 @@ EAPI void ecore_wl2_session_recovery_disable(void);
  */
 EAPI void ecore_wl2_window_commit(Ecore_Wl2_Window *window, Eina_Bool flush);
 
+EAPI void ecore_wl2_window_false_commit(Ecore_Wl2_Window *window);
+
 /**
  * Check if a wayland window's surface is in the pending state.
  *
index 9b22319..ebb7918 100644 (file)
@@ -1411,6 +1411,22 @@ ecore_wl2_window_commit(Ecore_Wl2_Window *window, Eina_Bool flush)
    window->updating = EINA_FALSE;
 }
 
+EAPI void ecore_wl2_window_false_commit(Ecore_Wl2_Window *window)
+{
+   EINA_SAFETY_ON_NULL_RETURN(window);
+   EINA_SAFETY_ON_NULL_RETURN(window->surface);
+   EINA_SAFETY_ON_TRUE_RETURN(window->pending.configure);
+
+   if (window->commit_pending)
+     ERR("Commit before previous commit processed");
+
+   window->callback = wl_surface_frame(window->surface);
+   wl_callback_add_listener(window->callback, &_frame_listener, window);
+   wl_surface_commit(window->surface);
+   ecore_wl2_display_flush(window->display);
+   window->commit_pending = EINA_TRUE;
+}
+
 EAPI Eina_Bool
 ecore_wl2_window_pending_get(Ecore_Wl2_Window *window)
 {