mesa: Remove support for creating color-index visuals
authorIan Romanick <ian.d.romanick@intel.com>
Thu, 25 Feb 2010 02:49:33 +0000 (18:49 -0800)
committerIan Romanick <ian.d.romanick@intel.com>
Wed, 3 Mar 2010 20:37:04 +0000 (12:37 -0800)
Remove the rgbMode and indexBits parameters from _mesa_create_visual
and _mesa_initialize_visual.  These values are now hardcoded to
GL_TRUE and 0.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
src/gallium/state_trackers/glx/xlib/xm_api.c
src/mesa/drivers/beos/GLView.cpp
src/mesa/drivers/fbdev/glfbdev.c
src/mesa/drivers/glslcompiler/glslcompiler.c
src/mesa/drivers/osmesa/osmesa.c
src/mesa/drivers/windows/gdi/wmesa.c
src/mesa/drivers/windows/gldirect/dglcontext.c
src/mesa/drivers/x11/xm_api.c
src/mesa/main/context.c
src/mesa/main/context.h

index 68518b1..217bdef 100644 (file)
@@ -746,10 +746,9 @@ XMesaVisual XMesaCreateVisual( Display *display,
    }
 
    _mesa_initialize_visual( &v->mesa_visual,
-                            rgb_flag, db_flag, stereo_flag,
+                            db_flag, stereo_flag,
                             red_bits, green_bits,
                             blue_bits, alpha_bits,
-                            v->mesa_visual.indexBits,
                             depth_size,
                             stencil_size,
                             accum_red_size, accum_green_size,
index 9e4a7eb..a029f6b 100644 (file)
@@ -297,11 +297,9 @@ BGLView::BGLView(BRect rect, char *name,
    MesaDriver * md = new MesaDriver();
 
    // examine option flags and create gl_context struct
-   GLvisual * visual = _mesa_create_visual( rgbFlag,
-                                            dblFlag,
+   GLvisual * visual = _mesa_create_visual( dblFlag,
                                             stereoFlag,
                                             red, green, blue, alpha,
-                                            index,
                                             depth,
                                             stencil,
                                             accum, accum, accum, accum,
index e6ece69..0ea2796 100644 (file)
@@ -327,7 +327,7 @@ glFBDevCreateVisual( const struct fb_fix_screeninfo *fixInfo,
    const int *attrib;
    GLboolean dbFlag = GL_FALSE, stereoFlag = GL_FALSE;
    GLint redBits = 0, greenBits = 0, blueBits = 0, alphaBits = 0;
-   GLint indexBits = 0, depthBits = 0, stencilBits = 0;
+   GLint depthBits = 0, stencilBits = 0;
    GLint accumRedBits = 0, accumGreenBits = 0;
    GLint accumBlueBits = 0, accumAlphaBits = 0;
    GLint numSamples = 0;
@@ -414,9 +414,9 @@ glFBDevCreateVisual( const struct fb_fix_screeninfo *fixInfo,
       }
    }
 
-   if (!_mesa_initialize_visual(&vis->glvisual, GL_TRUE, dbFlag, stereoFlag,
+   if (!_mesa_initialize_visual(&vis->glvisual, dbFlag, stereoFlag,
                                 redBits, greenBits, blueBits, alphaBits,
-                                indexBits, depthBits, stencilBits,
+                                depthBits, stencilBits,
                                 accumRedBits, accumGreenBits,
                                 accumBlueBits, accumAlphaBits,
                                 numSamples)) {
index 448029d..66035a4 100644 (file)
@@ -113,9 +113,9 @@ CreateContext(void)
    GLcontext *ctx;
    CompilerContext *cc;
 
-   vis = _mesa_create_visual(GL_TRUE, GL_FALSE, GL_FALSE, /* RGB */
+   vis = _mesa_create_visual(GL_FALSE, GL_FALSE, /* RGB */
                              8, 8, 8, 8,  /* color */
-                             0, 0, 0,  /* z, stencil */
+                             0, 0,  /* z, stencil */
                              0, 0, 0, 0, 1);  /* accum */
    buf = _mesa_create_framebuffer(vis);
 
index bb6dbdf..e20507a 100644 (file)
@@ -1116,14 +1116,12 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits,
 
    osmesa = (OSMesaContext) CALLOC_STRUCT(osmesa_context);
    if (osmesa) {
-      osmesa->gl_visual = _mesa_create_visual( GL_TRUE,     /* rgbMode */
-                                               GL_FALSE,    /* double buffer */
+      osmesa->gl_visual = _mesa_create_visual( GL_FALSE,    /* double buffer */
                                                GL_FALSE,    /* stereo */
                                                redBits,
                                                greenBits,
                                                blueBits,
                                                alphaBits,
-                                               0,
                                                depthBits,
                                                stencilBits,
                                                accumBits,
index 2fdcb38..91ddc36 100644 (file)
@@ -1461,12 +1461,10 @@ WMesaContext WMesaCreateContext(HDC hDC,
        break;
     }
     /* Create visual based on flags */
-    visual = _mesa_create_visual(rgb_flag,
-                                 db_flag,    /* db_flag */
+    visual = _mesa_create_visual(db_flag,    /* db_flag */
                                  GL_FALSE,   /* stereo */
                                  red_bits, green_bits, blue_bits, /* color RGB */
                                  alpha_flag ? alpha_bits : 0, /* color A */
-                                 0,          /* index bits */
                                  DEFAULT_SOFTWARE_DEPTH_BITS, /* depth_bits */
                                  8,          /* stencil_bits */
                                  16,16,16,   /* accum RGB */
index e9c23d1..a420b36 100644 (file)
@@ -1377,14 +1377,12 @@ SkipPrimaryCreate:
 
 #ifdef _USE_GLD3_WGL
        lpCtx->glVis = _mesa_create_visual(
-               GL_TRUE,                // RGB mode
                bDouble,    /* double buffer */
                GL_FALSE,                       // stereo
                lpPFD->cRedBits,
                lpPFD->cGreenBits,
                lpPFD->cBlueBits,
                dwAlphaBits,
-               0,                              // index bits
                dwDepthBits,
                dwStencilBits,
                lpPFD->cAccumRedBits,   // accum bits
index c59df55..a1723fa 100644 (file)
@@ -1443,10 +1443,9 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display,
    }
 
    _mesa_initialize_visual( &v->mesa_visual,
-                            GL_TRUE, db_flag, stereo_flag,
+                            db_flag, stereo_flag,
                             red_bits, green_bits,
                             blue_bits, alpha_bits,
-                            v->mesa_visual.indexBits,
                             depth_size,
                             stencil_size,
                             accum_red_size, accum_green_size,
index 4ecbb5e..b827d54 100644 (file)
@@ -184,7 +184,6 @@ _mesa_notifySwapBuffers(__GLcontext *ctx)
  * Allocates a GLvisual structure and initializes it via
  * _mesa_initialize_visual().
  * 
- * \param rgbFlag GL_TRUE for RGB(A) mode, GL_FALSE for Color Index mode.
  * \param dbFlag double buffering
  * \param stereoFlag stereo buffer
  * \param depthBits requested bits per depth buffer value. Any value in [0, 32]
@@ -206,14 +205,12 @@ _mesa_notifySwapBuffers(__GLcontext *ctx)
  * \note Need to add params for level and numAuxBuffers (at least)
  */
 GLvisual *
-_mesa_create_visual( GLboolean rgbFlag,
-                     GLboolean dbFlag,
+_mesa_create_visual( GLboolean dbFlag,
                      GLboolean stereoFlag,
                      GLint redBits,
                      GLint greenBits,
                      GLint blueBits,
                      GLint alphaBits,
-                     GLint indexBits,
                      GLint depthBits,
                      GLint stencilBits,
                      GLint accumRedBits,
@@ -224,9 +221,9 @@ _mesa_create_visual( GLboolean rgbFlag,
 {
    GLvisual *vis = (GLvisual *) calloc(1, sizeof(GLvisual));
    if (vis) {
-      if (!_mesa_initialize_visual(vis, rgbFlag, dbFlag, stereoFlag,
+      if (!_mesa_initialize_visual(vis, dbFlag, stereoFlag,
                                    redBits, greenBits, blueBits, alphaBits,
-                                   indexBits, depthBits, stencilBits,
+                                   depthBits, stencilBits,
                                    accumRedBits, accumGreenBits,
                                    accumBlueBits, accumAlphaBits,
                                    numSamples)) {
@@ -248,14 +245,12 @@ _mesa_create_visual( GLboolean rgbFlag,
  */
 GLboolean
 _mesa_initialize_visual( GLvisual *vis,
-                         GLboolean rgbFlag,
                          GLboolean dbFlag,
                          GLboolean stereoFlag,
                          GLint redBits,
                          GLint greenBits,
                          GLint blueBits,
                          GLint alphaBits,
-                         GLint indexBits,
                          GLint depthBits,
                          GLint stencilBits,
                          GLint accumRedBits,
@@ -277,7 +272,7 @@ _mesa_initialize_visual( GLvisual *vis,
    assert(accumBlueBits >= 0);
    assert(accumAlphaBits >= 0);
 
-   vis->rgbMode          = rgbFlag;
+   vis->rgbMode          = GL_TRUE;
    vis->doubleBufferMode = dbFlag;
    vis->stereoMode       = stereoFlag;
 
@@ -287,7 +282,7 @@ _mesa_initialize_visual( GLvisual *vis,
    vis->alphaBits        = alphaBits;
    vis->rgbBits          = redBits + greenBits + blueBits;
 
-   vis->indexBits      = indexBits;
+   vis->indexBits      = 0;
    vis->depthBits      = depthBits;
    vis->stencilBits    = stencilBits;
 
index c3be106..09bf177 100644 (file)
@@ -60,14 +60,12 @@ struct _glapi_table;
 /*@{*/
  
 extern GLvisual *
-_mesa_create_visual( GLboolean rgbFlag,
-                     GLboolean dbFlag,
+_mesa_create_visual( GLboolean dbFlag,
                      GLboolean stereoFlag,
                      GLint redBits,
                      GLint greenBits,
                      GLint blueBits,
                      GLint alphaBits,
-                     GLint indexBits,
                      GLint depthBits,
                      GLint stencilBits,
                      GLint accumRedBits,
@@ -78,14 +76,12 @@ _mesa_create_visual( GLboolean rgbFlag,
 
 extern GLboolean
 _mesa_initialize_visual( GLvisual *v,
-                         GLboolean rgbFlag,
                          GLboolean dbFlag,
                          GLboolean stereoFlag,
                          GLint redBits,
                          GLint greenBits,
                          GLint blueBits,
                          GLint alphaBits,
-                         GLint indexBits,
                          GLint depthBits,
                          GLint stencilBits,
                          GLint accumRedBits,