diff options
author | Brian Paul <[email protected]> | 2009-05-13 10:33:21 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-05-13 10:33:21 -0600 |
commit | 3039acfc5db67f3935f9c30a9f17193ab52b20a9 (patch) | |
tree | 49c770f360234977c1098e3d0c373da31ac7576c /src/glx/x11/glxcmds.c | |
parent | 10c4a10b979bddd099287dec5b69243c2ade8ade (diff) | |
parent | 2e4e34689022ecfcc7dc107427db90cc52a94d63 (diff) |
Merge branch 'mesa_7_5_branch'
Conflicts:
src/mesa/main/arrayobj.c
src/mesa/main/arrayobj.h
src/mesa/main/context.c
Diffstat (limited to 'src/glx/x11/glxcmds.c')
-rw-r--r-- | src/glx/x11/glxcmds.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/src/glx/x11/glxcmds.c b/src/glx/x11/glxcmds.c index b9e0706d312..ec3e69e4fe1 100644 --- a/src/glx/x11/glxcmds.c +++ b/src/glx/x11/glxcmds.c @@ -1319,30 +1319,31 @@ PUBLIC XVisualInfo *glXChooseVisual(Display *dpy, int screen, int *attribList) ** Eliminate visuals that don't meet minimum requirements ** Compute a score for those that do ** Remember which visual, if any, got the highest score + ** If no visual is acceptable, return None + ** Otherwise, create an XVisualInfo list with just the selected X visual + ** and return this. */ for ( modes = psc->visuals ; modes != NULL ; modes = modes->next ) { if ( fbconfigs_compatible( & test_config, modes ) && ((best_config == NULL) || (fbconfig_compare( (const __GLcontextModes * const * const)&modes, &best_config ) < 0)) ) { - best_config = modes; + XVisualInfo visualTemplate; + XVisualInfo *newList; + int i; + + visualTemplate.screen = screen; + visualTemplate.visualid = modes->visualID; + newList = XGetVisualInfo( dpy, VisualScreenMask|VisualIDMask, + &visualTemplate, &i ); + + if (newList) { + Xfree(visualList); + visualList = newList; + best_config = modes; + } } } - /* - ** If no visual is acceptable, return None - ** Otherwise, create an XVisualInfo list with just the selected X visual - ** and return this. - */ - if (best_config != NULL) { - XVisualInfo visualTemplate; - int i; - - visualTemplate.screen = screen; - visualTemplate.visualid = best_config->visualID; - visualList = XGetVisualInfo( dpy, VisualScreenMask|VisualIDMask, - &visualTemplate, &i ); - } - return visualList; } |