mesa: remove _mesa_create_context_for_api()
authorBrian Paul <brianp@vmware.com>
Wed, 9 Feb 2011 02:25:04 +0000 (19:25 -0700)
committerBrian Paul <brianp@vmware.com>
Wed, 9 Feb 2011 02:25:04 +0000 (19:25 -0700)
Just add the gl_api parameter to _mesa_create_context().

14 files changed:
src/mesa/drivers/beos/GLView.cpp
src/mesa/drivers/dri/i810/i810context.c
src/mesa/drivers/dri/mach64/mach64_context.c
src/mesa/drivers/dri/mga/mga_xmesa.c
src/mesa/drivers/dri/r128/r128_context.c
src/mesa/drivers/dri/radeon/radeon_common_context.c
src/mesa/drivers/dri/savage/savage_xmesa.c
src/mesa/drivers/dri/sis/sis_context.c
src/mesa/drivers/dri/tdfx/tdfx_context.c
src/mesa/drivers/dri/unichrome/via_context.c
src/mesa/drivers/windows/gldirect/dglcontext.c
src/mesa/main/context.c
src/mesa/main/context.h
src/mesa/state_tracker/st_context.c

index ee3415b..297e6e7 100644 (file)
@@ -319,7 +319,8 @@ BGLView::BGLView(BRect rect, char *name,
         functions.Viewport      = md->Viewport;
 
        // create core context
-       struct gl_context *ctx = _mesa_create_context(visual, NULL, &functions, md);
+       struct gl_context *ctx = _mesa_create_context(API_OPENGL, visual,
+                                                      NULL, &functions, md);
        if (! ctx) {
          _mesa_destroy_visual(visual);
          delete md;
index dc58e91..90dbb6b 100644 (file)
@@ -204,7 +204,7 @@ i810CreateContext( gl_api api,
       shareCtx = ((i810ContextPtr) sharedContextPrivate)->glCtx;
    else
       shareCtx = NULL;
-   imesa->glCtx = _mesa_create_context(mesaVis, shareCtx,
+   imesa->glCtx = _mesa_create_context(API_OPENGL, mesaVis, shareCtx,
                                        &functions, (void*) imesa);
    if (!imesa->glCtx) {
       FREE(imesa);
index 7c989df..35b01a9 100644 (file)
@@ -120,7 +120,7 @@ GLboolean mach64CreateContext( gl_api api,
       shareCtx = ((mach64ContextPtr) sharedContextPrivate)->glCtx;
    else 
       shareCtx = NULL;
-   mmesa->glCtx = _mesa_create_context(glVisual, shareCtx, 
+   mmesa->glCtx = _mesa_create_context(API_OPENGL, glVisual, shareCtx, 
                                        &functions, (void *)mmesa);
    if (!mmesa->glCtx) {
       FREE(mmesa);
index d1b281a..eb7df97 100644 (file)
@@ -457,7 +457,7 @@ mgaCreateContext( gl_api api,
       shareCtx = ((mgaContextPtr) sharedContextPrivate)->glCtx;
    else 
       shareCtx = NULL;
-   mmesa->glCtx = _mesa_create_context(mesaVis, shareCtx,
+   mmesa->glCtx = _mesa_create_context(API_OPENGL, mesaVis, shareCtx,
                                        &functions, (void *) mmesa);
    if (!mmesa->glCtx) {
       FREE(mmesa);
index 2741080..247d86c 100644 (file)
@@ -128,7 +128,7 @@ GLboolean r128CreateContext( gl_api api,
       shareCtx = ((r128ContextPtr) sharedContextPrivate)->glCtx;
    else 
       shareCtx = NULL;
-   rmesa->glCtx = _mesa_create_context(glVisual, shareCtx,
+   rmesa->glCtx = _mesa_create_context(API_OPENGL, glVisual, shareCtx,
                                        &functions, (void *) rmesa);
    if (!rmesa->glCtx) {
       FREE(rmesa);
index 819d9dd..c36cb9d 100644 (file)
@@ -204,7 +204,7 @@ GLboolean radeonInitContext(radeonContextPtr radeon,
                shareCtx = ((radeonContextPtr)sharedContextPrivate)->glCtx;
        else
                shareCtx = NULL;
-       radeon->glCtx = _mesa_create_context(glVisual, shareCtx,
+       radeon->glCtx = _mesa_create_context(API_OPENGL, glVisual, shareCtx,
                                            functions, (void *)radeon);
        if (!radeon->glCtx)
                return GL_FALSE;
index 92fb4f4..681ed9a 100644 (file)
@@ -314,7 +314,7 @@ savageCreateContext( gl_api api,
       shareCtx = ((savageContextPtr) sharedContextPrivate)->glCtx;
    else 
       shareCtx = NULL;
-   ctx = _mesa_create_context(mesaVis, shareCtx, &functions, imesa);
+   ctx = _mesa_create_context(api, mesaVis, shareCtx, &functions, imesa);
    if (!ctx) {
       free(imesa);
       return GL_FALSE;
index c5a9fdf..26ecfc4 100644 (file)
@@ -186,7 +186,7 @@ sisCreateContext( gl_api api,
       shareCtx = ((sisContextPtr)sharedContextPrivate)->glCtx;
    else 
       shareCtx = NULL;
-   smesa->glCtx = _mesa_create_context( glVisual, shareCtx,
+   smesa->glCtx = _mesa_create_context( API_OPENGL, glVisual, shareCtx,
                                         &functions, (void *) smesa);
    if (!smesa->glCtx) {
       FREE(smesa);
index 63dfa5a..ad15135 100644 (file)
@@ -194,7 +194,7 @@ GLboolean tdfxCreateContext( gl_api api,
    else 
       shareCtx = NULL;
 
-   fxMesa->glCtx = _mesa_create_context(mesaVis, shareCtx,
+   fxMesa->glCtx = _mesa_create_context(api, mesaVis, shareCtx,
                                         &functions, (void *) fxMesa);
    if (!fxMesa->glCtx) {
       FREE(fxMesa);
index 963609b..77d7116 100644 (file)
@@ -542,7 +542,7 @@ viaCreateContext(gl_api api,
     else
         shareCtx = NULL;
 
-    vmesa->glCtx = _mesa_create_context(visual, shareCtx, &functions,
+    vmesa->glCtx = _mesa_create_context(API_OPENGL, visual, shareCtx, &functions,
                                        (void*) vmesa);
     
     vmesa->shareCtx = shareCtx;
index 10ea057..9aedd2e 100644 (file)
@@ -1414,7 +1414,7 @@ SkipPrimaryCreate:
        }
 
 #ifdef _USE_GLD3_WGL
-       lpCtx->glCtx = _mesa_create_context(lpCtx->glVis, NULL, (void *)lpCtx, GL_TRUE);
+       lpCtx->glCtx = _mesa_create_context(API_OPENGL, lpCtx->glVis, NULL, (void *)lpCtx, GL_TRUE);
 #else
        // Create the Mesa context
        lpCtx->glCtx = (*mesaFuncs.gl_create_context)(
index 488859a..a942314 100644 (file)
@@ -1044,11 +1044,11 @@ _mesa_initialize_context(struct gl_context *ctx,
  * \return pointer to a new __struct gl_contextRec or NULL if error.
  */
 struct gl_context *
-_mesa_create_context_for_api(gl_api api,
-                            const struct gl_config *visual,
-                            struct gl_context *share_list,
-                            const struct dd_function_table *driverFunctions,
-                            void *driverContext)
+_mesa_create_context(gl_api api,
+                     const struct gl_config *visual,
+                     struct gl_context *share_list,
+                     const struct dd_function_table *driverFunctions,
+                     void *driverContext)
 {
    struct gl_context *ctx;
 
@@ -1071,22 +1071,6 @@ _mesa_create_context_for_api(gl_api api,
 
 
 /**
- * Create an OpenGL context.
- */
-struct gl_context *
-_mesa_create_context(const struct gl_config *visual,
-                    struct gl_context *share_list,
-                    const struct dd_function_table *driverFunctions,
-                    void *driverContext)
-{
-   return _mesa_create_context_for_api(API_OPENGL, visual,
-                                      share_list,
-                                      driverFunctions,
-                                      driverContext);
-}
-
-
-/**
  * Free the data associated with the given context.
  * 
  * But doesn't free the struct gl_context struct itself.
index 26b87ea..4e391dd 100644 (file)
@@ -99,12 +99,6 @@ _mesa_destroy_visual( struct gl_config *vis );
 /** \name Context-related functions */
 /*@{*/
 
-extern struct gl_context *
-_mesa_create_context( const struct gl_config *visual,
-                      struct gl_context *share_list,
-                      const struct dd_function_table *driverFunctions,
-                      void *driverContext );
-
 extern GLboolean
 _mesa_initialize_context( struct gl_context *ctx,
                           gl_api api,
@@ -114,11 +108,11 @@ _mesa_initialize_context( struct gl_context *ctx,
                           void *driverContext );
 
 extern struct gl_context *
-_mesa_create_context_for_api(gl_api api,
-                            const struct gl_config *visual,
-                            struct gl_context *share_list,
-                            const struct dd_function_table *driverFunctions,
-                            void *driverContext);
+_mesa_create_context(gl_api api,
+                     const struct gl_config *visual,
+                     struct gl_context *share_list,
+                     const struct dd_function_table *driverFunctions,
+                     void *driverContext);
 
 extern void
 _mesa_free_context_data( struct gl_context *ctx );
index c7f3949..dccbff3 100644 (file)
@@ -178,7 +178,7 @@ struct st_context *st_create_context(gl_api api, struct pipe_context *pipe,
    memset(&funcs, 0, sizeof(funcs));
    st_init_driver_functions(&funcs);
 
-   ctx = _mesa_create_context_for_api(api, visual, shareCtx, &funcs, NULL);
+   ctx = _mesa_create_context(api, visual, shareCtx, &funcs, NULL);
 
    /* XXX: need a capability bit in gallium to query if the pipe
     * driver prefers DP4 or MUL/MAD for vertex transformation.