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.
This commit is contained in:
Derek Foreman 2018-01-26 11:17:23 -06:00
parent e4122da211
commit 4d430a98bf
2 changed files with 15 additions and 6 deletions

View File

@ -2022,6 +2022,7 @@ 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);
EAPI Ecore_Wl2_Buffer *ecore_wl2_surface_buffer_create(Ecore_Wl2_Surface *surface);
# endif

View File

@ -90,12 +90,7 @@ _evas_dmabuf_surface_wait(Ecore_Wl2_Surface *s)
if (!best && (eina_list_count(s->buffers) < MAX_BUFFERS))
{
Ecore_Wl2_Display *ewd;
ewd = ecore_wl2_window_display_get(s->wl2_win);
EINA_SAFETY_ON_NULL_RETURN_VAL(ewd, NULL);
best = ecore_wl2_buffer_create(ewd, s->w, s->h, s->alpha);
best = ecore_wl2_surface_buffer_create(s);
/* Start at -1 so it's age is incremented to 0 for first draw */
ecore_wl2_buffer_age_set(best, -1);
s->buffers = eina_list_append(s->buffers, best);
@ -259,3 +254,16 @@ ecore_wl2_surface_create(Ecore_Wl2_Window *win, Eina_Bool alpha)
free(out);
return NULL;
}
EAPI Ecore_Wl2_Buffer *
ecore_wl2_surface_buffer_create(Ecore_Wl2_Surface *surface)
{
Ecore_Wl2_Display *ewd;
EINA_SAFETY_ON_NULL_RETURN_VAL(surface, NULL);
ewd = ecore_wl2_window_display_get(surface->wl2_win);
EINA_SAFETY_ON_NULL_RETURN_VAL(ewd, NULL);
return ecore_wl2_buffer_create(ewd, surface->w, surface->h, surface->alpha);
}