Merge branch '7.8'
[mesa.git] / src / gallium / state_trackers / glx / xlib / glx_api.c
index 656a69131e95c054a6bddf5700d16610923879cc..eb8d6a1933397b3295f5e6bf2afc1ab85c7a40cb 100644 (file)
 
 #include "xm_api.h"
 #include "main/context.h"
-#include "main/config.h"
 #include "main/macros.h"
 #include "main/imports.h"
 #include "main/version.h"
-#include "state_tracker/st_context.h"
-#include "state_tracker/st_public.h"
 
 
 /* This indicates the client-side GLX API and GLX encoder version. */
@@ -689,6 +686,8 @@ choose_visual( Display *dpy, int screen, const int *list, GLboolean fbConfig )
    int desiredVisualID = -1;
    int numAux = 0;
 
+   xmesa_init( dpy );
+
    parselist = list;
 
    while (*parselist) {
@@ -941,9 +940,6 @@ choose_visual( Display *dpy, int screen, const int *list, GLboolean fbConfig )
          /* give the visual some useful GLX attributes */
          double_flag = GL_TRUE;
          rgb_flag = GL_TRUE;
-         depth_size = default_depth_bits();
-         stencil_size = STENCIL_BITS;
-         /* XXX accum??? */
       }
    }
    else if (level==0) {
@@ -1305,7 +1301,7 @@ glXCopyContext( Display *dpy, GLXContext src, GLXContext dst,
    if (MakeCurrent_PrevContext == src) {
       _mesa_Flush();
    }
-   st_copy_context_state( xm_src->st, xm_dst->st, (GLuint) mask );
+   XMesaCopyContext(xm_src, xm_dst, mask);
 }
 
 
@@ -1762,6 +1758,10 @@ glXGetFBConfigs( Display *dpy, int screen, int *nelements )
       }
       for (i = 0; i < *nelements; i++) {
          results[i] = create_glx_visual(dpy, visuals + i);
+         if (!results[i]) {
+            *nelements = i;
+            break;
+         }
       }
       return (GLXFBConfig *) results;
    }