Mesa (master): dri_util: move context functions

George Sapountzis gsap7 at kemper.freedesktop.org
Fri Nov 4 21:34:26 UTC 2011


Module: Mesa
Branch: master
Commit: 2314021d603afa40321fb7b50881bc85d406c921
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2314021d603afa40321fb7b50881bc85d406c921

Author: George Sapountzis <gsapountzis at gmail.com>
Date:   Fri Nov  4 16:24:19 2011 +0200

dri_util: move context functions

---

 src/mesa/drivers/dri/common/dri_util.c |   71 ++++++++++++++++----------------
 1 files changed, 36 insertions(+), 35 deletions(-)

diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c
index 1023394..c79e93d 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -30,9 +30,6 @@ PUBLIC const char __dri2ConfigOptions[] =
 
 static const uint __dri2NConfigOptions = 1;
 
-static void dri_get_drawable(__DRIdrawable *pdp);
-static void dri_put_drawable(__DRIdrawable *pdp);
-
 /*****************************************************************/
 /** \name Screen handling functions                              */
 /*****************************************************************/
@@ -224,6 +221,41 @@ driCopyContext(__DRIcontext *dest, __DRIcontext *src, unsigned long mask)
 /*****************************************************************/
 /*@{*/
 
+static void dri_get_drawable(__DRIdrawable *pdp);
+static void dri_put_drawable(__DRIdrawable *pdp);
+
+/**
+ * This function takes both a read buffer and a draw buffer.  This is needed
+ * for \c glXMakeCurrentReadSGI or GLX 1.3's \c glXMakeContextCurrent
+ * function.
+ */
+static int driBindContext(__DRIcontext *pcp,
+			  __DRIdrawable *pdp,
+			  __DRIdrawable *prp)
+{
+    /*
+    ** Assume error checking is done properly in glXMakeCurrent before
+    ** calling driUnbindContext.
+    */
+
+    if (!pcp)
+	return GL_FALSE;
+
+    /* Bind the drawable to the context */
+    pcp->driDrawablePriv = pdp;
+    pcp->driReadablePriv = prp;
+    if (pdp) {
+	pdp->driContextPriv = pcp;
+	dri_get_drawable(pdp);
+    }
+    if (prp && pdp != prp) {
+	dri_get_drawable(prp);
+    }
+
+    /* Call device-specific MakeCurrent */
+    return driDriverAPI.MakeCurrent(pcp, pdp, prp);
+}
+
 /**
  * Unbind context.
  * 
@@ -289,37 +321,8 @@ static int driUnbindContext(__DRIcontext *pcp)
     return GL_TRUE;
 }
 
-/**
- * This function takes both a read buffer and a draw buffer.  This is needed
- * for \c glXMakeCurrentReadSGI or GLX 1.3's \c glXMakeContextCurrent
- * function.
- */
-static int driBindContext(__DRIcontext *pcp,
-			  __DRIdrawable *pdp,
-			  __DRIdrawable *prp)
-{
-    /*
-    ** Assume error checking is done properly in glXMakeCurrent before
-    ** calling driUnbindContext.
-    */
-
-    if (!pcp)
-	return GL_FALSE;
-
-    /* Bind the drawable to the context */
-    pcp->driDrawablePriv = pdp;
-    pcp->driReadablePriv = prp;
-    if (pdp) {
-	pdp->driContextPriv = pcp;
-	dri_get_drawable(pdp);
-    }
-    if (prp && pdp != prp) {
-	dri_get_drawable(prp);
-    }
+/*@}*/
 
-    /* Call device-specific MakeCurrent */
-    return driDriverAPI.MakeCurrent(pcp, pdp, prp);
-}
 
 static __DRIdrawable *
 dri2CreateNewDrawable(__DRIscreen *screen,
@@ -427,8 +430,6 @@ driDestroyDrawable(__DRIdrawable *pdp)
     dri_put_drawable(pdp);
 }
 
-/*@}*/
-
 static unsigned int
 dri2GetAPIMask(__DRIscreen *screen)
 {




More information about the mesa-commit mailing list