summaryrefslogtreecommitdiff
path: root/src/lib/ecore_wl2/ecore_wl2_surface.c
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2018-01-25 15:13:21 -0600
committerDerek Foreman <derekf@osg.samsung.com>2018-01-26 15:53:59 -0600
commit1c2bb7bda72f8122d6ae75ae346b9d2a321afb6f (patch)
tree975355b41b7062049e6c7db8777d0513e44c0164 /src/lib/ecore_wl2/ecore_wl2_surface.c
parentb87606775f596312408a19f3e3fba29a00663566 (diff)
ecore_wl2: Make the surface interface a pointer
Diffstat (limited to 'src/lib/ecore_wl2/ecore_wl2_surface.c')
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_surface.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_surface.c b/src/lib/ecore_wl2/ecore_wl2_surface.c
index 9ee1df9695..b7cda2f7a3 100644
--- a/src/lib/ecore_wl2/ecore_wl2_surface.c
+++ b/src/lib/ecore_wl2/ecore_wl2_surface.c
@@ -183,7 +183,7 @@ ecore_wl2_surface_destroy(Ecore_Wl2_Surface *surface)
183{ 183{
184 EINA_SAFETY_ON_NULL_RETURN(surface); 184 EINA_SAFETY_ON_NULL_RETURN(surface);
185 185
186 surface->funcs.destroy(surface); 186 surface->funcs->destroy(surface);
187 surface->wl2_win = NULL; 187 surface->wl2_win = NULL;
188 188
189 free(surface); 189 free(surface);
@@ -194,7 +194,7 @@ ecore_wl2_surface_reconfigure(Ecore_Wl2_Surface *surface, int w, int h, uint32_t
194{ 194{
195 EINA_SAFETY_ON_NULL_RETURN(surface); 195 EINA_SAFETY_ON_NULL_RETURN(surface);
196 196
197 surface->funcs.reconfigure(surface, w, h, flags, force); 197 surface->funcs->reconfigure(surface, w, h, flags, force);
198} 198}
199 199
200EAPI void * 200EAPI void *
@@ -202,7 +202,7 @@ ecore_wl2_surface_data_get(Ecore_Wl2_Surface *surface, int *w, int *h)
202{ 202{
203 EINA_SAFETY_ON_NULL_RETURN_VAL(surface, NULL); 203 EINA_SAFETY_ON_NULL_RETURN_VAL(surface, NULL);
204 204
205 return surface->funcs.data_get(surface, w, h); 205 return surface->funcs->data_get(surface, w, h);
206} 206}
207 207
208EAPI int 208EAPI int
@@ -210,7 +210,7 @@ ecore_wl2_surface_assign(Ecore_Wl2_Surface *surface)
210{ 210{
211 EINA_SAFETY_ON_NULL_RETURN_VAL(surface, 0); 211 EINA_SAFETY_ON_NULL_RETURN_VAL(surface, 0);
212 212
213 return surface->funcs.assign(surface); 213 return surface->funcs->assign(surface);
214} 214}
215 215
216EAPI void 216EAPI void
@@ -218,7 +218,7 @@ ecore_wl2_surface_post(Ecore_Wl2_Surface *surface, Eina_Rectangle *rects, unsign
218{ 218{
219 EINA_SAFETY_ON_NULL_RETURN(surface); 219 EINA_SAFETY_ON_NULL_RETURN(surface);
220 220
221 surface->funcs.post(surface, rects, count); 221 surface->funcs->post(surface, rects, count);
222} 222}
223 223
224EAPI void 224EAPI void
@@ -226,9 +226,20 @@ ecore_wl2_surface_flush(Ecore_Wl2_Surface *surface)
226{ 226{
227 EINA_SAFETY_ON_NULL_RETURN(surface); 227 EINA_SAFETY_ON_NULL_RETURN(surface);
228 228
229 surface->funcs.flush(surface); 229 surface->funcs->flush(surface);
230} 230}
231 231
232static Ecore_Wl2_Surface_Interface dmabuf_smanager =
233{
234 .check = _evas_dmabuf_surface_check,
235 .destroy = _evas_dmabuf_surface_destroy,
236 .reconfigure = _evas_dmabuf_surface_reconfigure,
237 .data_get = _evas_dmabuf_surface_data_get,
238 .assign = _evas_dmabuf_surface_assign,
239 .post = _evas_dmabuf_surface_post,
240 .flush = _surface_flush
241};
242
232EAPI Ecore_Wl2_Surface * 243EAPI Ecore_Wl2_Surface *
233ecore_wl2_surface_create(Ecore_Wl2_Window *win, Eina_Bool alpha) 244ecore_wl2_surface_create(Ecore_Wl2_Window *win, Eina_Bool alpha)
234{ 245{
@@ -244,16 +255,9 @@ ecore_wl2_surface_create(Ecore_Wl2_Window *win, Eina_Bool alpha)
244 out->alpha = alpha; 255 out->alpha = alpha;
245 out->w = 0; 256 out->w = 0;
246 out->h = 0; 257 out->h = 0;
258 out->funcs = &dmabuf_smanager;
247 259
248 out->funcs.check = _evas_dmabuf_surface_check; 260 if (out->funcs->check(win))
249 out->funcs.destroy = _evas_dmabuf_surface_destroy;
250 out->funcs.reconfigure = _evas_dmabuf_surface_reconfigure;
251 out->funcs.data_get = _evas_dmabuf_surface_data_get;
252 out->funcs.assign = _evas_dmabuf_surface_assign;
253 out->funcs.post = _evas_dmabuf_surface_post;
254 out->funcs.flush = _surface_flush;
255
256 if (out->funcs.check(win))
257 { 261 {
258 win->wl2_surface = out; 262 win->wl2_surface = out;
259 return out; 263 return out;