ecore_wl2: factor out part of buffer creation

So we can use it to make a non-immediate mode buffer test.
This commit is contained in:
Derek Foreman 2017-11-14 16:09:26 -06:00
parent 04cebba623
commit 3ac556f2e1
1 changed files with 13 additions and 2 deletions

View File

@ -533,8 +533,8 @@ ecore_wl2_buffer_destroy(Ecore_Wl2_Buffer *b)
free(b);
}
EAPI Ecore_Wl2_Buffer *
ecore_wl2_buffer_create(Ecore_Wl2_Display *ewd, int w, int h, Eina_Bool alpha)
static Ecore_Wl2_Buffer *
_ecore_wl2_buffer_partial_create(int w, int h, Eina_Bool alpha)
{
Ecore_Wl2_Buffer *out;
@ -553,6 +553,17 @@ ecore_wl2_buffer_create(Ecore_Wl2_Display *ewd, int w, int h, Eina_Bool alpha)
out->h = h;
out->size = out->stride * h;
return out;
}
EAPI Ecore_Wl2_Buffer *
ecore_wl2_buffer_create(Ecore_Wl2_Display *ewd, int w, int h, Eina_Bool alpha)
{
Ecore_Wl2_Buffer *out;
out = _ecore_wl2_buffer_partial_create(w, h, alpha);
if (!out) return NULL;
out->wl_buffer = ecore_wl2_buffer_wl_buffer_get(ewd, out);
return out;