summaryrefslogtreecommitdiff
path: root/src/lib/ecore_wl2/ecore_wl2_surface.c
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2018-01-26 11:17:23 -0600
committerDerek Foreman <derekf@osg.samsung.com>2018-01-26 15:54:00 -0600
commit4d430a98bfef0df78836d5458bc2c4c4282ca558 (patch)
treedfb0cc8842335837509c45178f747cfa8f8e0630 /src/lib/ecore_wl2/ecore_wl2_surface.c
parente4122da2113d8945086f70ced96c211fbc0dfdb5 (diff)
ecore_wl2: Add API surface_buffer_create
The specific surface code only needs these generic surface bits to pass to buffer_create, so make a helper function for that instead of queries for w, h, and alpha.
Diffstat (limited to 'src/lib/ecore_wl2/ecore_wl2_surface.c')
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_surface.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_surface.c b/src/lib/ecore_wl2/ecore_wl2_surface.c
index ca5bfc5a51..f9c1d8bc7d 100644
--- a/src/lib/ecore_wl2/ecore_wl2_surface.c
+++ b/src/lib/ecore_wl2/ecore_wl2_surface.c
@@ -90,12 +90,7 @@ _evas_dmabuf_surface_wait(Ecore_Wl2_Surface *s)
90 90
91 if (!best && (eina_list_count(s->buffers) < MAX_BUFFERS)) 91 if (!best && (eina_list_count(s->buffers) < MAX_BUFFERS))
92 { 92 {
93 Ecore_Wl2_Display *ewd; 93 best = ecore_wl2_surface_buffer_create(s);
94
95 ewd = ecore_wl2_window_display_get(s->wl2_win);
96 EINA_SAFETY_ON_NULL_RETURN_VAL(ewd, NULL);
97
98 best = ecore_wl2_buffer_create(ewd, s->w, s->h, s->alpha);
99 /* Start at -1 so it's age is incremented to 0 for first draw */ 94 /* Start at -1 so it's age is incremented to 0 for first draw */
100 ecore_wl2_buffer_age_set(best, -1); 95 ecore_wl2_buffer_age_set(best, -1);
101 s->buffers = eina_list_append(s->buffers, best); 96 s->buffers = eina_list_append(s->buffers, best);
@@ -259,3 +254,16 @@ ecore_wl2_surface_create(Ecore_Wl2_Window *win, Eina_Bool alpha)
259 free(out); 254 free(out);
260 return NULL; 255 return NULL;
261} 256}
257
258EAPI Ecore_Wl2_Buffer *
259ecore_wl2_surface_buffer_create(Ecore_Wl2_Surface *surface)
260{
261 Ecore_Wl2_Display *ewd;
262
263 EINA_SAFETY_ON_NULL_RETURN_VAL(surface, NULL);
264
265 ewd = ecore_wl2_window_display_get(surface->wl2_win);
266 EINA_SAFETY_ON_NULL_RETURN_VAL(ewd, NULL);
267
268 return ecore_wl2_buffer_create(ewd, surface->w, surface->h, surface->alpha);
269}