ecore_wl2: Add API ecore_wl2_window_surface_flush
authorDerek Foreman <derekf@osg.samsung.com>
Thu, 30 Nov 2017 21:33:38 +0000 (15:33 -0600)
committerDerek Foreman <derekf@osg.samsung.com>
Fri, 1 Dec 2017 16:59:51 +0000 (10:59 -0600)
This allows something that only has the Ecore_Wl2_Window (ie: something
that isn't engine code) to force dropping of all the buffers.

This should be safe to call at any time as the buffer handling logic
will properly cleanup the buffers when async render is done with them
or the compositor releases them.

This will eventually be used when a wayland client receives a
wl_output.leave events to indicate it isn't displayed on any outputs.

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

index a348357..97f53d5 100644 (file)
@@ -2004,6 +2004,7 @@ EAPI void *ecore_wl2_surface_data_get(Ecore_Wl2_Surface *surface, int *w, int *h
 EAPI int  ecore_wl2_surface_assign(Ecore_Wl2_Surface *surface);
 EAPI void ecore_wl2_surface_post(Ecore_Wl2_Surface *surface, Eina_Rectangle *rects, unsigned int count);
 EAPI void ecore_wl2_surface_flush(Ecore_Wl2_Surface *surface);
+EAPI void ecore_wl2_window_surface_flush(Ecore_Wl2_Window *window);
 
 # endif
 
index b23fb25..8f6a579 100644 (file)
@@ -1643,3 +1643,12 @@ ecore_wl2_window_damage(Ecore_Wl2_Window *window, Eina_Rectangle *rects, unsigne
    else
      damage(window->surface, 0, 0, INT_MAX, INT_MAX);
 }
+
+EAPI void
+ecore_wl2_window_surface_flush(Ecore_Wl2_Window *window)
+{
+   EINA_SAFETY_ON_NULL_RETURN(window);
+
+   if (!window->wl2_surface) return;
+   ecore_wl2_surface_flush(window->wl2_surface);
+}