summaryrefslogtreecommitdiff
path: root/src/lib/ecore_wl2/ecore_wl2_surface.c
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2017-11-30 15:19:17 -0600
committerDerek Foreman <derekf@osg.samsung.com>2017-12-01 10:58:44 -0600
commitc48ca81026b3c8f5b3a832419099696d0931f0f6 (patch)
treedf08ad95560b51d3b0c65abd1668d47989ef1ed8 /src/lib/ecore_wl2/ecore_wl2_surface.c
parentfdd05f8028c658534c6444f02fbfc40d92614903 (diff)
ecore_wl2: Add ecore_wl2_surface_flush
This removes all buffers from a surface.
Diffstat (limited to 'src/lib/ecore_wl2/ecore_wl2_surface.c')
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_surface.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_surface.c b/src/lib/ecore_wl2/ecore_wl2_surface.c
index 8fcf9c121c..cd810d21b5 100644
--- a/src/lib/ecore_wl2/ecore_wl2_surface.c
+++ b/src/lib/ecore_wl2/ecore_wl2_surface.c
@@ -148,6 +148,18 @@ _evas_dmabuf_surface_destroy(Ecore_Wl2_Surface *s)
148 ecore_wl2_buffer_destroy(b); 148 ecore_wl2_buffer_destroy(b);
149} 149}
150 150
151static void
152_surface_flush(Ecore_Wl2_Surface *surface)
153{
154 Ecore_Wl2_Buffer *b;
155
156 EINA_SAFETY_ON_NULL_RETURN(surface);
157
158 EINA_LIST_FREE(surface->buffers, b)
159 ecore_wl2_buffer_destroy(b);
160}
161
162
151EAPI void 163EAPI void
152ecore_wl2_surface_destroy(Ecore_Wl2_Surface *surface) 164ecore_wl2_surface_destroy(Ecore_Wl2_Surface *surface)
153{ 165{
@@ -191,6 +203,14 @@ ecore_wl2_surface_post(Ecore_Wl2_Surface *surface, Eina_Rectangle *rects, unsign
191 surface->funcs.post(surface, rects, count); 203 surface->funcs.post(surface, rects, count);
192} 204}
193 205
206EAPI void
207ecore_wl2_surface_flush(Ecore_Wl2_Surface *surface)
208{
209 EINA_SAFETY_ON_NULL_RETURN(surface);
210
211 surface->funcs.flush(surface);
212}
213
194EAPI Ecore_Wl2_Surface * 214EAPI Ecore_Wl2_Surface *
195ecore_wl2_surface_create(Ecore_Wl2_Window *win, Eina_Bool alpha) 215ecore_wl2_surface_create(Ecore_Wl2_Window *win, Eina_Bool alpha)
196{ 216{
@@ -224,6 +244,7 @@ ecore_wl2_surface_create(Ecore_Wl2_Window *win, Eina_Bool alpha)
224 out->funcs.data_get = _evas_dmabuf_surface_data_get; 244 out->funcs.data_get = _evas_dmabuf_surface_data_get;
225 out->funcs.assign = _evas_dmabuf_surface_assign; 245 out->funcs.assign = _evas_dmabuf_surface_assign;
226 out->funcs.post = _evas_dmabuf_surface_post; 246 out->funcs.post = _evas_dmabuf_surface_post;
247 out->funcs.flush = _surface_flush;
227 win->wl2_surface = out; 248 win->wl2_surface = out;
228 return out; 249 return out;
229 250