Just add the gl_api parameter to _mesa_initialize_context().tags/android-x86-2.2-r2
@@ -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; | |||
} |
@@ -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); |
@@ -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; | |||
} | |||
@@ -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); |
@@ -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, |
@@ -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); |
@@ -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); |
@@ -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 { |
@@ -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 ); | |||