mesa: remove _mesa_initialize_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_initialize_context().

src/mesa/drivers/dri/intel/intel_context.c
src/mesa/drivers/dri/nouveau/nouveau_context.c
src/mesa/drivers/dri/swrast/swrast.c
src/mesa/drivers/fbdev/glfbdev.c
src/mesa/drivers/osmesa/osmesa.c
src/mesa/drivers/windows/gdi/wmesa.c
src/mesa/drivers/x11/xm_api.c
src/mesa/main/context.c
src/mesa/main/context.h

index 432a22a7c3c0c7244a9b20b5b03de7638746687a..52af8eef575b76f0abda7711e0b8f5b50db6c014 100644 (file)
@@ -644,8 +644,8 @@ intelInitContext(struct intel_context *intel,
       mesaVis = &visual;
    }
 
-   if (!_mesa_initialize_context_for_api(&intel->ctx, api, mesaVis, shareCtx,
-                                        functions, (void *) intel)) {
+   if (!_mesa_initialize_context(&intel->ctx, api, mesaVis, shareCtx,
+                                 functions, (void *) intel)) {
       printf("%s: failed to init mesa context\n", __FUNCTION__);
       return GL_FALSE;
    }
index 53a121420d3af2bc4baf10342b92f4f2664219f6..71dde413873b42845232a99f3d17cb63bf032e70 100644 (file)
@@ -115,7 +115,8 @@ nouveau_context_init(struct gl_context *ctx, struct nouveau_screen *screen,
        nouveau_fbo_functions_init(&functions);
 
        /* Initialize the mesa context. */
-       _mesa_initialize_context(ctx, visual, share_ctx, &functions, NULL);
+       _mesa_initialize_context(ctx, API_OPENGL, visual,
+                                 share_ctx, &functions, NULL);
 
        nouveau_state_init(ctx);
        nouveau_bo_state_init(ctx);
index 144b187c15d4052328d6ebeddd167c148e9d5a13..719b406ec05feeef79ff22f8dace5ba3230d3954 100644 (file)
@@ -651,7 +651,7 @@ dri_create_context(gl_api api,
     mesaCtx = &ctx->Base;
 
     /* basic context setup */
-    if (!_mesa_initialize_context_for_api(mesaCtx, api, visual, sharedCtx, &functions, (void *) cPriv)) {
+    if (!_mesa_initialize_context(mesaCtx, api, visual, sharedCtx, &functions, (void *) cPriv)) {
        goto context_fail;
     }
 
index 5195bca97fa5e5437f4aaa5ddc742200d19e9bdf..1e0ac4c7a1f6c34fc7d84f4f53898d6ae037737e 100644 (file)
@@ -722,7 +722,7 @@ glFBDevCreateContext( const GLFBDevVisualPtr visual, GLFBDevContextPtr share )
    functions.GetBufferSize = get_buffer_size;
    functions.Viewport = viewport;
 
-   if (!_mesa_initialize_context(&ctx->glcontext, &visual->glvisual,
+   if (!_mesa_initialize_context(&ctx->glcontext, API_OPENGL, &visual->glvisual,
                                  share ? &share->glcontext : NULL,
                                  &functions, (void *) ctx)) {
       free(ctx);
index e1f0c69bacfb10446ae3292325a6f9ec4a757920..98f01fe057ea20385166c764451ed76237411002 100644 (file)
@@ -1155,6 +1155,7 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits,
       functions.GetBufferSize = NULL;
 
       if (!_mesa_initialize_context(&osmesa->mesa,
+                                    API_OPENGL,
                                     osmesa->gl_visual,
                                     sharelist ? &sharelist->mesa
                                               : (struct gl_context *) NULL,
index 833e2526f3c12359083455d57288a10fed0c36bd..4a8b1b283d50135a169ba47f16e7c59555f05926 100644 (file)
@@ -1479,7 +1479,8 @@ WMesaContext WMesaCreateContext(HDC hDC,
 
     /* initialize the Mesa context data */
     ctx = &c->gl_ctx;
-    _mesa_initialize_context(ctx, visual, NULL, &functions, (void *)c);
+    _mesa_initialize_context(ctx, API_OPENGL, visual,
+                             NULL, &functions, (void *)c);
 
     /* visual no longer needed - it was copied by _mesa_initialize_context() */
     _mesa_destroy_visual(visual);
index b5eabadf486b5158f1efb3cbc38b332af2b1f962..cb71b344a26dbc2ecccec29e4a49066543a689c2 100644 (file)
@@ -1398,7 +1398,7 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
    /* initialize with default driver functions, then plug in XMesa funcs */
    _mesa_init_driver_functions(&functions);
    xmesa_init_driver_functions(v, &functions);
-   if (!_mesa_initialize_context(mesaCtx, &v->mesa_visual,
+   if (!_mesa_initialize_context(mesaCtx, API_OPENGL, &v->mesa_visual,
                       share_list ? &(share_list->mesa) : (struct gl_context *) NULL,
                       &functions, (void *) c)) {
       free(c);
index e017939a45c55275b59b6ebce0591dc489145c7c..488859aa2feb405cebd09ebabf87ad13f35b4945 100644 (file)
@@ -886,12 +886,12 @@ _mesa_alloc_dispatch_table(int size)
  * \param driverContext pointer to driver-specific context data
  */
 GLboolean
-_mesa_initialize_context_for_api(struct gl_context *ctx,
-                                gl_api api,
-                                const struct gl_config *visual,
-                                struct gl_context *share_list,
-                                const struct dd_function_table *driverFunctions,
-                                void *driverContext)
+_mesa_initialize_context(struct gl_context *ctx,
+                         gl_api api,
+                         const struct gl_config *visual,
+                         struct gl_context *share_list,
+                         const struct dd_function_table *driverFunctions,
+                         void *driverContext)
 {
    struct gl_shared_state *shared;
    int i;
@@ -1028,25 +1028,6 @@ _mesa_initialize_context_for_api(struct gl_context *ctx,
 }
 
 
-/**
- * Initialize an OpenGL context.
- */
-GLboolean
-_mesa_initialize_context(struct gl_context *ctx,
-                         const struct gl_config *visual,
-                         struct gl_context *share_list,
-                         const struct dd_function_table *driverFunctions,
-                         void *driverContext)
-{
-   return _mesa_initialize_context_for_api(ctx,
-                                          API_OPENGL,
-                                          visual,
-                                          share_list,
-                                          driverFunctions,
-                                          driverContext);
-}
-
-
 /**
  * Allocate and initialize a struct gl_context structure.
  * Note that the driver needs to pass in its dd_function_table here since
@@ -1078,8 +1059,8 @@ _mesa_create_context_for_api(gl_api api,
    if (!ctx)
       return NULL;
 
-   if (_mesa_initialize_context_for_api(ctx, api, visual, share_list,
-                                       driverFunctions, driverContext)) {
+   if (_mesa_initialize_context(ctx, api, visual, share_list,
+                                driverFunctions, driverContext)) {
       return ctx;
    }
    else {
index 8fb9b4c6b7a6a99aae843bd91b7e0e1ac63e0619..26b87eab785409d0e0946041535cdeeafc1dd56b 100644 (file)
@@ -107,6 +107,7 @@ _mesa_create_context( const struct gl_config *visual,
 
 extern GLboolean
 _mesa_initialize_context( struct gl_context *ctx,
+                          gl_api api,
                           const struct gl_config *visual,
                           struct gl_context *share_list,
                           const struct dd_function_table *driverFunctions,
@@ -119,14 +120,6 @@ _mesa_create_context_for_api(gl_api api,
                             const struct dd_function_table *driverFunctions,
                             void *driverContext);
 
-extern GLboolean
-_mesa_initialize_context_for_api(struct gl_context *ctx,
-                                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 );