ecore_wl2: Add lock/unlock function pointers to buffers

For backend specific lock/unlock behaviour
This commit is contained in:
Derek Foreman 2018-03-09 14:32:20 -06:00
parent 52e2ef8b22
commit 1fddfdfaae
1 changed files with 4 additions and 0 deletions

View File

@ -39,6 +39,8 @@ struct _Buffer_Manager
void *(*map)(Ecore_Wl2_Buffer *buf);
void (*unmap)(Ecore_Wl2_Buffer *buf);
void (*discard)(Ecore_Wl2_Buffer *buf);
void (*lock)(Ecore_Wl2_Buffer *buf);
void (*unlock)(Ecore_Wl2_Buffer *buf);
void (*manager_destroy)(void);
void *priv;
void *dl_handle;
@ -667,12 +669,14 @@ ecore_wl2_buffer_discard(Ecore_Wl2_Buffer *buf)
EAPI void
ecore_wl2_buffer_lock(Ecore_Wl2_Buffer *b)
{
if (buffer_manager->lock) buffer_manager->lock(b);
b->locked = EINA_TRUE;
}
EAPI void
ecore_wl2_buffer_unlock(Ecore_Wl2_Buffer *b)
{
if (buffer_manager->unlock) buffer_manager->unlock(b);
ecore_wl2_buffer_unmap(b);
b->mapping = NULL;
b->locked = EINA_FALSE;