ecore_wl2: Add API for querying buffer lock status and use it
Since surfaces will be managed by plug-ins, we need to make sure they don't rely on internal structures.
This commit is contained in:
parent
1c2bb7bda7
commit
e3a3e02042
|
@ -2007,6 +2007,7 @@ EAPI void ecore_wl2_buffer_unmap(Ecore_Wl2_Buffer *buf);
|
|||
EAPI void ecore_wl2_buffer_discard(Ecore_Wl2_Buffer *buf);
|
||||
EAPI void ecore_wl2_buffer_unlock(Ecore_Wl2_Buffer *b);
|
||||
EAPI void ecore_wl2_buffer_destroy(Ecore_Wl2_Buffer *b);
|
||||
EAPI Eina_Bool ecore_wl2_buffer_busy_get(Ecore_Wl2_Buffer *buffer);
|
||||
|
||||
EAPI Ecore_Wl2_Surface *ecore_wl2_surface_create(Ecore_Wl2_Window *win, Eina_Bool alpha);
|
||||
EAPI void ecore_wl2_surface_destroy(Ecore_Wl2_Surface *surface);
|
||||
|
|
|
@ -672,6 +672,14 @@ ecore_wl2_buffer_destroy(Ecore_Wl2_Buffer *b)
|
|||
free(b);
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
ecore_wl2_buffer_busy_get(Ecore_Wl2_Buffer *buffer)
|
||||
{
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(buffer, EINA_FALSE);
|
||||
|
||||
return (buffer->locked) || (buffer->busy);
|
||||
}
|
||||
|
||||
static Ecore_Wl2_Buffer *
|
||||
_ecore_wl2_buffer_partial_create(int w, int h, Eina_Bool alpha)
|
||||
{
|
||||
|
|
|
@ -87,7 +87,7 @@ _evas_dmabuf_surface_wait(Ecore_Wl2_Surface *s)
|
|||
|
||||
EINA_LIST_FOREACH(s->buffers, l, b)
|
||||
{
|
||||
if (b->locked || b->busy) continue;
|
||||
if (ecore_wl2_buffer_busy_get(b)) continue;
|
||||
if (b->age > best_age)
|
||||
{
|
||||
best = b;
|
||||
|
|
Loading…
Reference in New Issue