#include "list.h"
static tbm_bufmgr g_surface_bufmgr = NULL;
-struct list_head g_surface_list; /* list of surfaces belonging to bufmgr */
-
static pthread_mutex_t tbm_surface_lock;
static bool
_tbm_surface_internal_destroy (tbm_surface_h surface)
{
int i;
+ tbm_bufmgr bufmgr = surface->bufmgr;
for (i = 0; i < surface->num_bos; i++)
{
free (surface);
surface = NULL;
- if(LIST_IS_EMPTY (&g_surface_list))
+ if(LIST_IS_EMPTY (&bufmgr->surf_list))
{
+ LIST_DELINIT (&bufmgr->surf_list);
_deinit_surface_bufmgr ();
- LIST_DELINIT (&g_surface_list);
}
}
if (!g_surface_bufmgr)
{
_init_surface_bufmgr();
- LIST_INITHEAD (&g_surface_list);
+ LIST_INITHEAD (&g_surface_bufmgr->surf_list);
}
mgr = g_surface_bufmgr;
if (!g_surface_bufmgr)
{
_init_surface_bufmgr();
- LIST_INITHEAD (&g_surface_list);
+ LIST_INITHEAD (&g_surface_bufmgr->surf_list);
}
mgr = g_surface_bufmgr;
free (surf);
surf = NULL;
- if(LIST_IS_EMPTY (&g_surface_list))
+ if(LIST_IS_EMPTY (&mgr->surf_list))
{
+ LIST_DELINIT (&mgr->surf_list);
_deinit_surface_bufmgr ();
- LIST_DELINIT (&g_surface_list);
}
_tbm_surface_mutex_unlock();
}
}
- LIST_ADD (&surf->item_link, &g_surface_list);
+ LIST_ADD (&surf->item_link, &mgr->surf_list);
_tbm_surface_mutex_unlock();
if (!g_surface_bufmgr)
{
_init_surface_bufmgr();
- LIST_INITHEAD (&g_surface_list);
+ LIST_INITHEAD (&g_surface_bufmgr->surf_list);
}
mgr = g_surface_bufmgr;
surf->bos[i] = tbm_bo_ref(bos[i]);
}
- LIST_ADD (&surf->item_link, &g_surface_list);
+ LIST_ADD (&surf->item_link, &mgr->surf_list);
_tbm_surface_mutex_unlock();
free (surf);
surf = NULL;
- if(LIST_IS_EMPTY (&g_surface_list))
+ if(LIST_IS_EMPTY (&g_surface_bufmgr->surf_list))
{
+ LIST_DELINIT (&g_surface_bufmgr->surf_list);
_deinit_surface_bufmgr ();
- LIST_DELINIT (&g_surface_list);
}
_tbm_surface_mutex_unlock();