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 68518b19b91662355f3414eb406d0a6428dbcdf0..217bdeff75e8deb87736b7d89a7b68eba0277f5d 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 9e4a7ebe56ed639f3070ce6cc26b1d23e6090fa7..a029f6b200c722ec3d7378b010d9392a932e94f0 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 e6ece69a6456fa7c3e370ead5fb14e513a5c8ce9..0ea2796eaabaa2a6bd51373fa6794d6624a7b0e6 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 448029dacea53fe11310d2b2957d16d397cecb69..66035a4a43c140f2795ec1b4e8540d1993b6aa62 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 bb6dbdf1c08e74ef2b2614f93151124c368a35f8..e20507ae92fa578426e6ba58675e15da688ae428 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 2fdcb387be746a7f63cbe1c865c6d3d38d1e2f83..91ddc3615a10370651a6699af13647370ada620d 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 e9c23d1ccb034be69bb2b3e9cc3b82893649d238..a420b36ffb4a3c98f53c53dadef102b4becd1bd0 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 c59df55166fa68b90bb3cc918a1f868c155c117f..a1723fa37b199b7fa6b7188dd36adf7d19758ab1 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 4ecbb5ecf66502d92814f343139c735e01f3ddbd..b827d54176e940818a6df67ba9f2c4f98881eeff 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 c3be1063f86ff16c599e8e55726f41a13f34a740..09bf1777dabcfeaa31efcbdc7ce049849dd28c0a 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,