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:10:22 -0600
committerDerek Foreman <derekf@osg.samsung.com>2017-12-01 10:58:44 -0600
commitfdd05f8028c658534c6444f02fbfc40d92614903 (patch)
tree0811037fd5e68c20744d7f9e099226fb3cca2aed /src/lib/ecore_wl2/ecore_wl2_surface.c
parent4f63f327b0619f7c059f4b726fbf3199d5d59649 (diff)
ecore_wl2: add Ecore_Wl2_Surface to Ecore_Wl2_Window
Track the surface of a window and only allow one. Eventually this might be worthwhile to apply to subsurfaces, but for today lazy is the way.
Diffstat (limited to 'src/lib/ecore_wl2/ecore_wl2_surface.c')
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_surface.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_surface.c b/src/lib/ecore_wl2/ecore_wl2_surface.c
index 9a1c8ea1c6..8fcf9c121c 100644
--- a/src/lib/ecore_wl2/ecore_wl2_surface.c
+++ b/src/lib/ecore_wl2/ecore_wl2_surface.c
@@ -146,8 +146,6 @@ _evas_dmabuf_surface_destroy(Ecore_Wl2_Surface *s)
146 146
147 EINA_LIST_FREE(s->buffers, b) 147 EINA_LIST_FREE(s->buffers, b)
148 ecore_wl2_buffer_destroy(b); 148 ecore_wl2_buffer_destroy(b);
149
150 free(s);
151} 149}
152 150
153EAPI void 151EAPI void
@@ -156,6 +154,9 @@ ecore_wl2_surface_destroy(Ecore_Wl2_Surface *surface)
156 EINA_SAFETY_ON_NULL_RETURN(surface); 154 EINA_SAFETY_ON_NULL_RETURN(surface);
157 155
158 surface->funcs.destroy(surface); 156 surface->funcs.destroy(surface);
157 surface->wl2_win = NULL;
158
159 free(surface);
159} 160}
160 161
161EAPI void 162EAPI void
@@ -197,6 +198,10 @@ ecore_wl2_surface_create(Ecore_Wl2_Window *win, Eina_Bool alpha)
197 Ecore_Wl2_Display *ewd; 198 Ecore_Wl2_Display *ewd;
198 Ecore_Wl2_Buffer_Type types = 0; 199 Ecore_Wl2_Buffer_Type types = 0;
199 200
201 EINA_SAFETY_ON_NULL_RETURN_VAL(win, NULL);
202
203 if (win->wl2_surface) return win->wl2_surface;
204
200 out = calloc(1, sizeof(*out)); 205 out = calloc(1, sizeof(*out));
201 if (!out) return NULL; 206 if (!out) return NULL;
202 out->wl2_win = win; 207 out->wl2_win = win;
@@ -219,7 +224,7 @@ ecore_wl2_surface_create(Ecore_Wl2_Window *win, Eina_Bool alpha)
219 out->funcs.data_get = _evas_dmabuf_surface_data_get; 224 out->funcs.data_get = _evas_dmabuf_surface_data_get;
220 out->funcs.assign = _evas_dmabuf_surface_assign; 225 out->funcs.assign = _evas_dmabuf_surface_assign;
221 out->funcs.post = _evas_dmabuf_surface_post; 226 out->funcs.post = _evas_dmabuf_surface_post;
222 227 win->wl2_surface = out;
223 return out; 228 return out;
224 229
225err: 230err: