[PATCH 1/3] Do not create visuals from fbConfigs which don't support window drawables.

Jon TURNEY jon.turney at dronecode.org.uk
Fri Apr 16 08:24:22 PDT 2010


It is implicit that visuals are suitable for use with a window.

Glean (for e.g.) assumes all visuals support window drawables.

glXChooseVisual() documentation also says:
"There is no direct filter for picking only visuals that support GLXPixmaps.
GLXPixmaps are supported for visuals whose GLX_BUFFER_SIZE  is one of the
pixmap depths supported by the X server."

This appears to perhaps mean that we should also only create visuals from
fbConfigs which have a GLX_BUFFER_SIZE which is one of the Pixmap depths
supported by the X server if drawableType contains GLX_PIXMAP_BIT.

Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
---
 glx/glxscreens.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/glx/glxscreens.c b/glx/glxscreens.c
index 58d8ee0..6eef9fc 100644
--- a/glx/glxscreens.c
+++ b/glx/glxscreens.c
@@ -450,6 +450,10 @@ void __glXScreenInit(__GLXscreen *pGlxScreen, ScreenPtr pScreen)
 	if (i == pScreen->numVisuals)
 	    continue;
 
+        /* Make sure the FBconfig supports window drawables */
+        if (!(config->drawableType & GLX_WINDOW_BIT))
+          continue;
+
 	/* Create a new X visual for our FBconfig. */
 	visual = AddScreenVisuals(pScreen, 1, depth);
 	if (visual == NULL)
-- 
1.7.0.4



More information about the xorg-devel mailing list