Drop GLcontext typedef and use struct gl_context instead

parent 31aca27c
......@@ -854,7 +854,7 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
if (!xmdpy)
return NULL;
/* Note: the XMesaContext contains a Mesa GLcontext struct (inheritance) */
/* Note: the XMesaContext contains a Mesa struct gl_context struct (inheritance) */
c = (XMesaContext) CALLOC_STRUCT(xmesa_context);
if (!c)
return NULL;
......
......@@ -30,12 +30,12 @@
#include "ast.h"
extern "C" struct gl_shader *
_mesa_new_shader(GLcontext *ctx, GLuint name, GLenum type);
_mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type);
gl_shader *
read_builtins(GLenum target, const char *protos, const char **functions, unsigned count)
{
GLcontext fakeCtx;
struct gl_context fakeCtx;
fakeCtx.API = API_OPENGL;
gl_shader *sh = _mesa_new_shader(NULL, 0, target);
struct _mesa_glsl_parse_state *st =
......
......@@ -123,12 +123,12 @@ if __name__ == "__main__":
#include "ast.h"
extern "C" struct gl_shader *
_mesa_new_shader(GLcontext *ctx, GLuint name, GLenum type);
_mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type);
gl_shader *
read_builtins(GLenum target, const char *protos, const char **functions, unsigned count)
{
GLcontext fakeCtx;
struct gl_context fakeCtx;
fakeCtx.API = API_OPENGL;
gl_shader *sh = _mesa_new_shader(NULL, 0, target);
struct _mesa_glsl_parse_state *st =
......
......@@ -27,7 +27,7 @@
extern "C" {
#include <talloc.h>
#include "main/core.h" /* for struct __GLcontextRec */
#include "main/core.h" /* for struct gl_context */
}
#include "ast.h"
......@@ -36,7 +36,7 @@ extern "C" {
#include "ir_optimization.h"
#include "loop_analysis.h"
_mesa_glsl_parse_state::_mesa_glsl_parse_state(struct __GLcontextRec *ctx,
_mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *ctx,
GLenum target, void *mem_ctx)
{
switch (target) {
......
......@@ -41,10 +41,10 @@ enum _mesa_glsl_parser_targets {
ir_shader
};
struct __GLcontextRec;
struct gl_context;
struct _mesa_glsl_parse_state {
_mesa_glsl_parse_state(struct __GLcontextRec *ctx, GLenum target,
_mesa_glsl_parse_state(struct gl_context *ctx, GLenum target,
void *mem_ctx);
/* Callers of this talloc-based new need not call delete. It's
......
......@@ -719,7 +719,7 @@ get_main_function_signature(gl_shader *sh)
* shader is returned.
*/
static struct gl_shader *
link_intrastage_shaders(GLcontext *ctx,
link_intrastage_shaders(struct gl_context *ctx,
struct gl_shader_program *prog,
struct gl_shader **shader_list,
unsigned num_shaders)
......@@ -1386,7 +1386,7 @@ assign_varying_locations(struct gl_shader_program *prog,
void
link_shaders(GLcontext *ctx, struct gl_shader_program *prog)
link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
{
prog->LinkStatus = false;
prog->Validated = false;
......
......@@ -38,12 +38,12 @@
#include "loop_analysis.h"
extern "C" struct gl_shader *
_mesa_new_shader(GLcontext *ctx, GLuint name, GLenum type);
_mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type);
/* Copied from shader_api.c for the stand-alone compiler.
*/
struct gl_shader *
_mesa_new_shader(GLcontext *ctx, GLuint name, GLenum type)
_mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type)
{
struct gl_shader *shader;
......@@ -60,7 +60,7 @@ _mesa_new_shader(GLcontext *ctx, GLuint name, GLenum type)
}
static void
initialize_context(GLcontext *ctx, gl_api api)
initialize_context(struct gl_context *ctx, gl_api api)
{
memset(ctx, 0, sizeof(*ctx));
......@@ -160,7 +160,7 @@ const struct option compiler_opts[] = {
};
void
compile_shader(GLcontext *ctx, struct gl_shader *shader)
compile_shader(struct gl_context *ctx, struct gl_shader *shader)
{
struct _mesa_glsl_parse_state *state =
new(shader) _mesa_glsl_parse_state(ctx, shader->Type, shader);
......@@ -252,8 +252,8 @@ int
main(int argc, char **argv)
{
int status = EXIT_SUCCESS;
GLcontext local_ctx;
GLcontext *ctx = &local_ctx;
struct gl_context local_ctx;
struct gl_context *ctx = &local_ctx;
int c;
int idx = 0;
......
......@@ -24,4 +24,4 @@
#include "main/core.h"
extern void
link_shaders(GLcontext *ctx, struct gl_shader_program *prog);
link_shaders(struct gl_context *ctx, struct gl_shader_program *prog);
......@@ -95,7 +95,7 @@ _GLAPI_EXPORT extern const struct _glapi_table *_glapi_Dispatch;
_GLAPI_EXPORT extern const void *_glapi_Context;
# define GET_DISPATCH() _glapi_tls_Dispatch
# define GET_CURRENT_CONTEXT(C) GLcontext *C = (GLcontext *) _glapi_tls_Context
# define GET_CURRENT_CONTEXT(C) struct gl_context *C = (struct gl_context *) _glapi_tls_Context
#else
......@@ -107,13 +107,13 @@ _GLAPI_EXPORT extern void *_glapi_Context;
# define GET_DISPATCH() \
(likely(_glapi_Dispatch) ? _glapi_Dispatch : _glapi_get_dispatch())
# define GET_CURRENT_CONTEXT(C) GLcontext *C = (GLcontext *) \
# define GET_CURRENT_CONTEXT(C) struct gl_context *C = (struct gl_context *) \
(likely(_glapi_Context) ? _glapi_Context : _glapi_get_context())
# else
# define GET_DISPATCH() _glapi_Dispatch
# define GET_CURRENT_CONTEXT(C) GLcontext *C = (GLcontext *) _glapi_Context
# define GET_CURRENT_CONTEXT(C) struct gl_context *C = (struct gl_context *) _glapi_Context
# endif
......
This diff is collapsed.
......@@ -224,7 +224,7 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
* Only the Intel drivers use this so far.
*/
void
_mesa_init_driver_state(GLcontext *ctx)
_mesa_init_driver_state(struct gl_context *ctx)
{
ctx->Driver.AlphaFunc(ctx, ctx->Color.AlphaFunc, ctx->Color.AlphaRef);
......
......@@ -31,7 +31,7 @@ _mesa_init_driver_functions(struct dd_function_table *driver);
extern void
_mesa_init_driver_state(GLcontext *ctx);
_mesa_init_driver_state(struct gl_context *ctx);
#endif
This diff is collapsed.
......@@ -28,89 +28,89 @@
extern void
_mesa_meta_init(GLcontext *ctx);
_mesa_meta_init(struct gl_context *ctx);
extern void
_mesa_meta_free(GLcontext *ctx);
_mesa_meta_free(struct gl_context *ctx);
extern void
_mesa_meta_BlitFramebuffer(GLcontext *ctx,
_mesa_meta_BlitFramebuffer(struct gl_context *ctx,
GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
GLbitfield mask, GLenum filter);
extern void
_mesa_meta_Clear(GLcontext *ctx, GLbitfield buffers);
_mesa_meta_Clear(struct gl_context *ctx, GLbitfield buffers);
extern void
_mesa_meta_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy,
_mesa_meta_CopyPixels(struct gl_context *ctx, GLint srcx, GLint srcy,
GLsizei width, GLsizei height,
GLint dstx, GLint dsty, GLenum type);
extern void
_mesa_meta_DrawPixels(GLcontext *ctx,
_mesa_meta_DrawPixels(struct gl_context *ctx,
GLint x, GLint y, GLsizei width, GLsizei height,
GLenum format, GLenum type,
const struct gl_pixelstore_attrib *unpack,
const GLvoid *pixels);
extern void
_mesa_meta_Bitmap(GLcontext *ctx,
_mesa_meta_Bitmap(struct gl_context *ctx,
GLint x, GLint y, GLsizei width, GLsizei height,
const struct gl_pixelstore_attrib *unpack,
const GLubyte *bitmap);
extern GLboolean
_mesa_meta_check_generate_mipmap_fallback(GLcontext *ctx, GLenum target,
_mesa_meta_check_generate_mipmap_fallback(struct gl_context *ctx, GLenum target,
struct gl_texture_object *texObj);
extern void
_mesa_meta_GenerateMipmap(GLcontext *ctx, GLenum target,
_mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target,
struct gl_texture_object *texObj);
extern void
_mesa_meta_CopyTexImage1D(GLcontext *ctx, GLenum target, GLint level,
_mesa_meta_CopyTexImage1D(struct gl_context *ctx, GLenum target, GLint level,
GLenum internalFormat, GLint x, GLint y,
GLsizei width, GLint border);
extern void
_mesa_meta_CopyTexImage2D(GLcontext *ctx, GLenum target, GLint level,
_mesa_meta_CopyTexImage2D(struct gl_context *ctx, GLenum target, GLint level,
GLenum internalFormat, GLint x, GLint y,
GLsizei width, GLsizei height, GLint border);
extern void
_mesa_meta_CopyTexSubImage1D(GLcontext *ctx, GLenum target, GLint level,
_mesa_meta_CopyTexSubImage1D(struct gl_context *ctx, GLenum target, GLint level,
GLint xoffset,
GLint x, GLint y, GLsizei width);
extern void
_mesa_meta_CopyTexSubImage2D(GLcontext *ctx, GLenum target, GLint level,
_mesa_meta_CopyTexSubImage2D(struct gl_context *ctx, GLenum target, GLint level,
GLint xoffset, GLint yoffset,
GLint x, GLint y,
GLsizei width, GLsizei height);
extern void
_mesa_meta_CopyTexSubImage3D(GLcontext *ctx, GLenum target, GLint level,
_mesa_meta_CopyTexSubImage3D(struct gl_context *ctx, GLenum target, GLint level,
GLint xoffset, GLint yoffset, GLint zoffset,
GLint x, GLint y,
GLsizei width, GLsizei height);
extern void
_mesa_meta_CopyColorTable(GLcontext *ctx,
_mesa_meta_CopyColorTable(struct gl_context *ctx,
GLenum target, GLenum internalformat,
GLint x, GLint y, GLsizei width);
extern void
_mesa_meta_CopyColorSubTable(GLcontext *ctx,GLenum target, GLsizei start,
_mesa_meta_CopyColorSubTable(struct gl_context *ctx,GLenum target, GLsizei start,
GLint x, GLint y, GLsizei width);
extern void
_mesa_meta_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target,
_mesa_meta_CopyConvolutionFilter1D(struct gl_context *ctx, GLenum target,
GLenum internalFormat,
GLint x, GLint y, GLsizei width);
extern void
_mesa_meta_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target,
_mesa_meta_CopyConvolutionFilter2D(struct gl_context *ctx, GLenum target,
GLenum internalFormat, GLint x, GLint y,
GLsizei width, GLsizei height);
......
......@@ -21,7 +21,7 @@
#define HAVE_HW_DEPTH_PIXELS 0
#endif
static void TAG(WriteDepthSpan)( GLcontext *ctx,
static void TAG(WriteDepthSpan)( struct gl_context *ctx,
struct gl_renderbuffer *rb,
GLuint n, GLint x, GLint y,
const void *values,
......@@ -72,7 +72,7 @@ static void TAG(WriteDepthSpan)( GLcontext *ctx,
#if HAVE_HW_DEPTH_SPANS
/* implement MonoWriteDepthSpan() in terms of WriteDepthSpan() */
static void
TAG(WriteMonoDepthSpan)( GLcontext *ctx, struct gl_renderbuffer *rb,
TAG(WriteMonoDepthSpan)( struct gl_context *ctx, struct gl_renderbuffer *rb,
GLuint n, GLint x, GLint y,
const void *value, const GLubyte mask[] )
{
......@@ -84,7 +84,7 @@ TAG(WriteMonoDepthSpan)( GLcontext *ctx, struct gl_renderbuffer *rb,
TAG(WriteDepthSpan)(ctx, rb, n, x, y, depths, mask);
}
#else
static void TAG(WriteMonoDepthSpan)( GLcontext *ctx,
static void TAG(WriteMonoDepthSpan)( struct gl_context *ctx,
struct gl_renderbuffer *rb,
GLuint n, GLint x, GLint y,
const void *value,
......@@ -124,7 +124,7 @@ static void TAG(WriteMonoDepthSpan)( GLcontext *ctx,
#endif
static void TAG(WriteDepthPixels)( GLcontext *ctx,
static void TAG(WriteDepthPixels)( struct gl_context *ctx,
struct gl_renderbuffer *rb,
GLuint n,
const GLint x[],
......@@ -173,7 +173,7 @@ static void TAG(WriteDepthPixels)( GLcontext *ctx,
/* Read depth spans and pixels
*/
static void TAG(ReadDepthSpan)( GLcontext *ctx,
static void TAG(ReadDepthSpan)( struct gl_context *ctx,
struct gl_renderbuffer *rb,
GLuint n, GLint x, GLint y,
void *values )
......@@ -207,7 +207,7 @@ static void TAG(ReadDepthSpan)( GLcontext *ctx,
HW_READ_UNLOCK();
}
static void TAG(ReadDepthPixels)( GLcontext *ctx,
static void TAG(ReadDepthPixels)( struct gl_context *ctx,
struct gl_renderbuffer *rb,
GLuint n,
const GLint x[], const GLint y[],
......
......@@ -41,7 +41,7 @@
void
meta_set_passthrough_transform(struct dri_metaops *meta)
{
GLcontext *ctx = meta->ctx;
struct gl_context *ctx = meta->ctx;
meta->saved_vp_x = ctx->Viewport.X;
meta->saved_vp_y = ctx->Viewport.Y;
......@@ -87,7 +87,7 @@ meta_restore_transform(struct dri_metaops *meta)
void
meta_set_passthrough_vertex_program(struct dri_metaops *meta)
{
GLcontext *ctx = meta->ctx;
struct gl_context *ctx = meta->ctx;
static const char *vp =
"!!ARBvp1.0\n"
"TEMP vertexClip;\n"
......@@ -133,7 +133,7 @@ meta_set_passthrough_vertex_program(struct dri_metaops *meta)