[Mesa-dev] [PATCH 08/27] dri: Fold driCreateNewDrawable into dri2CreateNewDrawable

Kristian Høgsberg krh at bitplanet.net
Fri Oct 28 15:11:38 PDT 2011


---
 src/mesa/drivers/dri/common/dri_util.c |   81 +++++++++++---------------------
 1 files changed, 28 insertions(+), 53 deletions(-)

diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c
index 46ef661..15f600c 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;
+    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;
 
-    pdp->driScreenPriv = psp;
+    pdraw->driScreenPriv = screen;
 
-    if (!(*psp->DriverAPI.CreateBuffer)(psp, pdp, &config->modes, 0)) {
-       free(pdp);
+    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;
-- 
1.7.7



More information about the mesa-dev mailing list