diff options
author | Kristian Høgsberg <[email protected]> | 2011-10-28 15:14:41 -0400 |
---|---|---|
committer | Kristian Høgsberg <[email protected]> | 2011-11-02 11:15:58 -0400 |
commit | f5ba7662bdaf7f8d62cbc1c0c0a59dabb242e78b (patch) | |
tree | 93496283b560b3782868daac39c80164ec593ee2 /src/mesa/drivers/dri | |
parent | c786debe98a54bdaaccccb2af6272749a96a9489 (diff) |
dri: Fold driCreateNewDrawable into dri2CreateNewDrawable
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r-- | src/mesa/drivers/dri/common/dri_util.c | 85 |
1 files changed, 30 insertions, 55 deletions
diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index 46ef661791a..15f600c0348 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -321,74 +321,49 @@ static void driSwapBuffers(__DRIdrawable *dPriv) free(rects); } -/** - * This is called via __DRIscreenRec's createNewDrawable pointer. - */ static __DRIdrawable * -driCreateNewDrawable(__DRIscreen *psp, const __DRIconfig *config, - drm_drawable_t hwDrawable, int renderType, - const int *attrs, void *data) +dri2CreateNewDrawable(__DRIscreen *screen, + const __DRIconfig *config, + void *loaderPrivate) { - __DRIdrawable *pdp; - - /* Since pbuffers are not yet supported, no drawable attributes are - * supported either. - */ - (void) attrs; - (void) renderType; + __DRIdrawable *pdraw; - pdp = malloc(sizeof *pdp); - if (!pdp) { + pdraw = malloc(sizeof *pdraw); + if (!pdraw) return NULL; - } - pdp->driContextPriv = NULL; - pdp->loaderPrivate = data; - pdp->hHWDrawable = hwDrawable; - pdp->refcount = 1; - pdp->pStamp = NULL; - pdp->lastStamp = 0; - pdp->index = 0; - pdp->x = 0; - pdp->y = 0; - pdp->w = 0; - pdp->h = 0; - pdp->numClipRects = 0; - pdp->numBackClipRects = 0; - pdp->pClipRects = NULL; - pdp->pBackClipRects = NULL; - pdp->vblSeq = 0; - pdp->vblFlags = 0; - - pdp->driScreenPriv = psp; - - if (!(*psp->DriverAPI.CreateBuffer)(psp, pdp, &config->modes, 0)) { - free(pdp); + pdraw->driContextPriv = NULL; + pdraw->loaderPrivate = loaderPrivate; + pdraw->hHWDrawable = 0; + pdraw->refcount = 1; + pdraw->pStamp = NULL; + pdraw->lastStamp = 0; + pdraw->index = 0; + pdraw->x = 0; + pdraw->y = 0; + pdraw->w = 0; + pdraw->h = 0; + pdraw->numClipRects = 0; + pdraw->numBackClipRects = 0; + pdraw->pClipRects = NULL; + pdraw->pBackClipRects = NULL; + pdraw->vblSeq = 0; + pdraw->vblFlags = 0; + + pdraw->driScreenPriv = screen; + + if (!(*screen->DriverAPI.CreateBuffer)(screen, pdraw, &config->modes, 0)) { + free(pdraw); return NULL; } - pdp->msc_base = 0; + pdraw->msc_base = 0; /* This special default value is replaced with the configured * default value when the drawable is first bound to a direct * rendering context. */ - pdp->swap_interval = (unsigned)-1; - - return pdp; -} - - -static __DRIdrawable * -dri2CreateNewDrawable(__DRIscreen *screen, - const __DRIconfig *config, - void *loaderPrivate) -{ - __DRIdrawable *pdraw; - - pdraw = driCreateNewDrawable(screen, config, 0, 0, NULL, loaderPrivate); - if (!pdraw) - return NULL; + pdraw->swap_interval = (unsigned)-1; pdraw->pClipRects = &pdraw->dri2.clipRect; pdraw->pBackClipRects = &pdraw->dri2.clipRect; |