xserver: Branch 'xgl-0-0-1'

David Reveman davidr at kemper.freedesktop.org
Mon Sep 25 18:26:07 EEST 2006


 hw/xgl/glxext/xglglxext.c |   47 +++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 40 insertions(+), 7 deletions(-)

New commits:
diff-tree 526238a26d05fc04093a3604e68bb86e06381ab3 (from 2c7ac2d891135d1658ab3b5e5fb0702276776d17)
Author: David Reveman <davidr at novell.com>
Date:   Mon Sep 25 11:25:16 2006 -0400

    Always allow use of native GL with overlay windows.

diff --git a/hw/xgl/glxext/xglglxext.c b/hw/xgl/glxext/xglglxext.c
index 89f0602..d851b2a 100644
--- a/hw/xgl/glxext/xglglxext.c
+++ b/hw/xgl/glxext/xglglxext.c
@@ -41,6 +41,7 @@
 #include "glapitable.h"
 #include "glxext.h"
 #include "micmap.h"
+#include "compint.h"
 
 #define XGL_MAX_TEXTURE_UNITS      8
 #define XGL_MAX_ATTRIB_STACK_DEPTH 16
@@ -5611,6 +5612,7 @@ xglCreateDrawable (__GLXcontext *context
     ScreenPtr	    pScreen = pDrawable->pScreen;
     xglGLBufferPtr  pBufferPriv;
     xglVisualPtr    v;
+    Bool	    useMesa;
 
     XGL_SCREEN_PRIV (pScreen);
     XGL_DRAWABLE_PIXMAP (pDrawable);
@@ -5687,25 +5689,56 @@ xglCreateDrawable (__GLXcontext *context
 	pBufferPriv->pVisual = v;
     }
 
-    if ((pDrawable->type == DRAWABLE_WINDOW)
+    useMesa = TRUE;
+
+    if (pDrawable->type == DRAWABLE_WINDOW)
+    {
 
 #ifdef COMPOSITE
-	&& (pBufferPriv->pVisual
+	if (pBufferPriv->pVisual)
+	{
+	    useMesa = FALSE;
+	}
+	else
+	{
+	    WindowPtr pWin = (WindowPtr) pDrawable;
 
 	    /* this is a root window, can't be redirected */
-	    || (!((WindowPtr) pDrawable)->parent))
+	    if (!pWin->parent)
+	    {
+		useMesa = FALSE;
+	    }
+	    else
+	    {
+		CompScreenPtr cs = GetCompScreen (pScreen);
+
+		/* allow native GL with overlay windows */
+		for (; pWin; pWin = pWin->parent)
+		{
+		    if (pWin == cs->pOverlayWin)
+		    {
+			useMesa = FALSE;
+			break;
+		    }
+		}
+	    }
+	}
+#else
+	    useMesa = FALSE;
 #endif
 
-	)
-    {
-	pBufferPriv->pDrawable = pDrawable;
     }
-    else
+
+    if (useMesa)
     {
 	pBufferPriv->mesaDrawable = (*mesaContext->createDrawable) (mesaContext,
 								    pDrawable,
 								    drawId);
     }
+    else
+    {
+	pBufferPriv->pDrawable = pDrawable;
+    }
 
     return &pBufferPriv->base;
 }



More information about the xorg-commit mailing list