mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-29 10:10:09 +01:00
dri_util: move drawable functions
This commit is contained in:
parent
2314021d60
commit
2fbba6bb90
1 changed files with 26 additions and 27 deletions
|
|
@ -324,6 +324,26 @@ static int driUnbindContext(__DRIcontext *pcp)
|
|||
/*@}*/
|
||||
|
||||
|
||||
static void dri_get_drawable(__DRIdrawable *pdp)
|
||||
{
|
||||
pdp->refcount++;
|
||||
}
|
||||
|
||||
static void dri_put_drawable(__DRIdrawable *pdp)
|
||||
{
|
||||
__DRIscreen *psp;
|
||||
|
||||
if (pdp) {
|
||||
pdp->refcount--;
|
||||
if (pdp->refcount)
|
||||
return;
|
||||
|
||||
psp = pdp->driScreenPriv;
|
||||
driDriverAPI.DestroyBuffer(pdp);
|
||||
free(pdp);
|
||||
}
|
||||
}
|
||||
|
||||
static __DRIdrawable *
|
||||
dri2CreateNewDrawable(__DRIscreen *screen,
|
||||
const __DRIconfig *config,
|
||||
|
|
@ -353,6 +373,12 @@ dri2CreateNewDrawable(__DRIscreen *screen,
|
|||
return pdraw;
|
||||
}
|
||||
|
||||
static void
|
||||
driDestroyDrawable(__DRIdrawable *pdp)
|
||||
{
|
||||
dri_put_drawable(pdp);
|
||||
}
|
||||
|
||||
static __DRIbuffer *
|
||||
dri2AllocateBuffer(__DRIscreen *screen,
|
||||
unsigned int attachment, unsigned int format,
|
||||
|
|
@ -403,33 +429,6 @@ dri2ConfigQueryf(__DRIscreen *screen, const char *var, GLfloat *val)
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static void dri_get_drawable(__DRIdrawable *pdp)
|
||||
{
|
||||
pdp->refcount++;
|
||||
}
|
||||
|
||||
static void dri_put_drawable(__DRIdrawable *pdp)
|
||||
{
|
||||
__DRIscreen *psp;
|
||||
|
||||
if (pdp) {
|
||||
pdp->refcount--;
|
||||
if (pdp->refcount)
|
||||
return;
|
||||
|
||||
psp = pdp->driScreenPriv;
|
||||
driDriverAPI.DestroyBuffer(pdp);
|
||||
free(pdp);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
driDestroyDrawable(__DRIdrawable *pdp)
|
||||
{
|
||||
dri_put_drawable(pdp);
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
dri2GetAPIMask(__DRIscreen *screen)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue