diff options
author | George Sapountzis <[email protected]> | 2011-11-04 16:25:51 +0200 |
---|---|---|
committer | George Sapountzis <[email protected]> | 2011-11-04 23:33:06 +0200 |
commit | 2fbba6bb906a4389de64cc6e961b531d8cd5c495 (patch) | |
tree | 3e0c79a474c041b848e4ba15d6c2557ae4b65e5a /src/mesa/drivers | |
parent | 2314021d603afa40321fb7b50881bc85d406c921 (diff) |
dri_util: move drawable functions
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/common/dri_util.c | 53 |
1 files changed, 26 insertions, 27 deletions
diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index c79e93d032b..c69fdce4405 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -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) { |