Commit f9995b30 authored by Kristian Høgsberg's avatar Kristian Høgsberg

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
......@@ -284,7 +284,7 @@ struct gl_meta_state
* To be called once during context creation.
*/
void
_mesa_meta_init(GLcontext *ctx)
_mesa_meta_init(struct gl_context *ctx)
{
ASSERT(!ctx->Meta);
......@@ -297,7 +297,7 @@ _mesa_meta_init(GLcontext *ctx)
* To be called once during context destruction.
*/
void
_mesa_meta_free(GLcontext *ctx)
_mesa_meta_free(struct gl_context *ctx)
{
/* Note: Any textures, VBOs, etc, that we allocate should get
* freed by the normal context destruction code. But this would be
......@@ -316,7 +316,7 @@ _mesa_meta_free(GLcontext *ctx)
* to save and reset to their defaults
*/
static void
_mesa_meta_begin(GLcontext *ctx, GLbitfield state)
_mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
{
struct save_state *save = &ctx->Meta->Save;
......@@ -557,7 +557,7 @@ _mesa_meta_begin(GLcontext *ctx, GLbitfield state)
* Leave meta state. This is like a light-weight version of glPopAttrib().
*/
static void
_mesa_meta_end(GLcontext *ctx)
_mesa_meta_end(struct gl_context *ctx)
{
struct save_state *save = &ctx->Meta->Save;
const GLbitfield state = save->SavedState;
......@@ -824,7 +824,7 @@ invert_z(GLfloat normZ)
* Choose tex target, compute max tex size, etc.
*/
static void
init_temp_texture(GLcontext *ctx, struct temp_texture *tex)
init_temp_texture(struct gl_context *ctx, struct temp_texture *tex)
{
/* prefer texture rectangle */
if (ctx->Extensions.NV_texture_rectangle) {
......@@ -850,7 +850,7 @@ init_temp_texture(GLcontext *ctx, struct temp_texture *tex)
* This does some one-time init if needed.
*/
static struct temp_texture *
get_temp_texture(GLcontext *ctx)
get_temp_texture(struct gl_context *ctx)
{
struct temp_texture *tex = &ctx->Meta->TempTex;
......@@ -868,7 +868,7 @@ get_temp_texture(GLcontext *ctx)
* allocation/deallocation.
*/
static struct temp_texture *
get_bitmap_temp_texture(GLcontext *ctx)
get_bitmap_temp_texture(struct gl_context *ctx)
{
struct temp_texture *tex = &ctx->Meta->Bitmap.Tex;
......@@ -984,7 +984,7 @@ setup_copypix_texture(struct temp_texture *tex,
* Setup/load texture for glDrawPixels.
*/
static void
setup_drawpix_texture(GLcontext *ctx,
setup_drawpix_texture(struct gl_context *ctx,
struct temp_texture *tex,
GLboolean newTex,
GLenum texIntFormat,
......@@ -1035,7 +1035,7 @@ setup_drawpix_texture(GLcontext *ctx,
* One-time init for drawing depth pixels.
*/
static void
init_blit_depth_pixels(GLcontext *ctx)
init_blit_depth_pixels(struct gl_context *ctx)
{
static const char *program =
"!!ARBfp1.0\n"
......@@ -1072,7 +1072,7 @@ init_blit_depth_pixels(GLcontext *ctx)
* normal path.
*/
static GLbitfield
blitframebuffer_texture(GLcontext *ctx,
blitframebuffer_texture(struct gl_context *ctx,
GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
GLbitfield mask, GLenum filter)
......@@ -1201,7 +1201,7 @@ blitframebuffer_texture(GLcontext *ctx,
* of texture mapping and polygon rendering.
*/
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)
......@@ -1362,7 +1362,7 @@ _mesa_meta_BlitFramebuffer(GLcontext *ctx,
* Meta implementation of ctx->Driver.Clear() in terms of polygon rendering.
*/
void
_mesa_meta_Clear(GLcontext *ctx, GLbitfield buffers)
_mesa_meta_Clear(struct gl_context *ctx, GLbitfield buffers)
{
struct clear_state *clear = &ctx->Meta->Clear;
struct vertex {
......@@ -1480,7 +1480,7 @@ _mesa_meta_Clear(GLcontext *ctx, GLbitfield buffers)
* of texture mapping and polygon rendering.
*/
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)
{
......@@ -1594,7 +1594,7 @@ _mesa_meta_CopyPixels(GLcontext *ctx, GLint srcX, GLint srcY,
* into tiles which fit into the max texture size.
*/
static void
tiled_draw_pixels(GLcontext *ctx,
tiled_draw_pixels(struct gl_context *ctx,
GLint tileSize,
GLint x, GLint y, GLsizei width, GLsizei height,
GLenum format, GLenum type,
......@@ -1630,7 +1630,7 @@ tiled_draw_pixels(GLcontext *ctx,
* One-time init for drawing stencil pixels.
*/
static void