From: Brian Paul Date: Wed, 9 Feb 2011 02:25:04 +0000 (-0700) Subject: mesa: remove _mesa_initialize_context_for_api() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5e4ca1ccc9029fd75bb7676dc128e33d12da9665;p=mesa.git mesa: remove _mesa_initialize_context_for_api() Just add the gl_api parameter to _mesa_initialize_context(). --- diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index 432a22a7c3c..52af8eef575 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -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; } diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c index 53a121420d3..71dde413873 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c @@ -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); diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c index 144b187c15d..719b406ec05 100644 --- a/src/mesa/drivers/dri/swrast/swrast.c +++ b/src/mesa/drivers/dri/swrast/swrast.c @@ -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; } diff --git a/src/mesa/drivers/fbdev/glfbdev.c b/src/mesa/drivers/fbdev/glfbdev.c index 5195bca97fa..1e0ac4c7a1f 100644 --- a/src/mesa/drivers/fbdev/glfbdev.c +++ b/src/mesa/drivers/fbdev/glfbdev.c @@ -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); diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c index e1f0c69bacf..98f01fe057e 100644 --- a/src/mesa/drivers/osmesa/osmesa.c +++ b/src/mesa/drivers/osmesa/osmesa.c @@ -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, diff --git a/src/mesa/drivers/windows/gdi/wmesa.c b/src/mesa/drivers/windows/gdi/wmesa.c index 833e2526f3c..4a8b1b283d5 100644 --- a/src/mesa/drivers/windows/gdi/wmesa.c +++ b/src/mesa/drivers/windows/gdi/wmesa.c @@ -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); diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index b5eabadf486..cb71b344a26 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -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); diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index e017939a45c..488859aa2fe 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -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 { diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h index 8fb9b4c6b7a..26b87eab785 100644 --- a/src/mesa/main/context.h +++ b/src/mesa/main/context.h @@ -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 );