From 7658fc101f59a27a4cd18c8fb51c9ea38d9f2b4b Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Thu, 30 Nov 2017 15:33:38 -0600 Subject: [PATCH] ecore_wl2: Add API ecore_wl2_window_surface_flush 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 | 1 + src/lib/ecore_wl2/ecore_wl2_window.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h index a348357b25..97f53d5ab8 100644 --- a/src/lib/ecore_wl2/Ecore_Wl2.h +++ b/src/lib/ecore_wl2/Ecore_Wl2.h @@ -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 diff --git a/src/lib/ecore_wl2/ecore_wl2_window.c b/src/lib/ecore_wl2/ecore_wl2_window.c index b23fb252b6..8f6a579a4a 100644 --- a/src/lib/ecore_wl2/ecore_wl2_window.c +++ b/src/lib/ecore_wl2/ecore_wl2_window.c @@ -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); +}