summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/x11
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2010-10-17 19:03:42 -0700
committerKeith Whitwell <[email protected]>2010-10-17 19:09:42 -0700
commit0072acd447dc6be652e63752e50215c3105322c8 (patch)
tree847d1763b54772d336a04e606f8248291c3092b7 /src/mesa/drivers/x11
parent543fb77ddece7e1806e8eaa0d65bb2a945ef9a75 (diff)
parentca2b2ac131933b4171b519813df1aaa3a81621cd (diff)
Merge remote branch 'origin/master' into lp-setup-llvm
Conflicts: src/gallium/drivers/llvmpipe/lp_setup_coef.c src/gallium/drivers/llvmpipe/lp_setup_coef.h src/gallium/drivers/llvmpipe/lp_setup_coef_intrin.c src/gallium/drivers/llvmpipe/lp_setup_point.c src/gallium/drivers/llvmpipe/lp_setup_tri.c src/gallium/drivers/llvmpipe/lp_state_derived.c src/gallium/drivers/llvmpipe/lp_state_fs.h
Diffstat (limited to 'src/mesa/drivers/x11')
-rw-r--r--src/mesa/drivers/x11/xm_api.c34
-rw-r--r--src/mesa/drivers/x11/xm_buffer.c6
-rw-r--r--src/mesa/drivers/x11/xm_dd.c60
-rw-r--r--src/mesa/drivers/x11/xm_line.c10
-rw-r--r--src/mesa/drivers/x11/xm_span.c20
-rw-r--r--src/mesa/drivers/x11/xm_tri.c4
-rw-r--r--src/mesa/drivers/x11/xmesaP.h36
-rw-r--r--src/mesa/drivers/x11/xmesa_x.h2
8 files changed, 87 insertions, 85 deletions
diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c
index dac1668cfe1..00ceb960c62 100644
--- a/src/mesa/drivers/x11/xm_api.c
+++ b/src/mesa/drivers/x11/xm_api.c
@@ -349,7 +349,7 @@ XMesaBuffer XMesaBufferList = NULL;
/**
* Allocate a new XMesaBuffer object which corresponds to the given drawable.
- * Note that XMesaBuffer is derived from GLframebuffer.
+ * Note that XMesaBuffer is derived from struct gl_framebuffer.
* The new XMesaBuffer will not have any size (Width=Height=0).
*
* \param d the corresponding X drawable (window or pixmap)
@@ -1047,7 +1047,7 @@ initialize_visual_and_buffer(XMesaVisual v, XMesaBuffer b,
XMesaColormap cmap)
{
int client = 0;
- const int xclass = v->mesa_visual.visualType;
+ const int xclass = v->visualType;
#ifdef XFree86Server
client = (window) ? CLIENT_ID(window->id) : 0;
@@ -1200,7 +1200,7 @@ initialize_visual_and_buffer(XMesaVisual v, XMesaBuffer b,
* Convert an RGBA color to a pixel value.
*/
unsigned long
-xmesa_color_to_pixel(GLcontext *ctx,
+xmesa_color_to_pixel(struct gl_context *ctx,
GLubyte r, GLubyte g, GLubyte b, GLubyte a,
GLuint pixelFormat)
{
@@ -1397,20 +1397,20 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display,
v->mesa_visual.redMask = visinfo->redMask;
v->mesa_visual.greenMask = visinfo->greenMask;
v->mesa_visual.blueMask = visinfo->blueMask;
- v->mesa_visual.visualID = visinfo->vid;
- v->mesa_visual.screen = 0; /* FIXME: What should be done here? */
+ v->visualID = visinfo->vid;
+ v->screen = 0; /* FIXME: What should be done here? */
#else
v->mesa_visual.redMask = visinfo->red_mask;
v->mesa_visual.greenMask = visinfo->green_mask;
v->mesa_visual.blueMask = visinfo->blue_mask;
- v->mesa_visual.visualID = visinfo->visualid;
- v->mesa_visual.screen = visinfo->screen;
+ v->visualID = visinfo->visualid;
+ v->screen = visinfo->screen;
#endif
#if defined(XFree86Server) || !(defined(__cplusplus) || defined(c_plusplus))
- v->mesa_visual.visualType = xmesa_convert_from_x_visual_type(visinfo->class);
+ v->visualType = xmesa_convert_from_x_visual_type(visinfo->class);
#else
- v->mesa_visual.visualType = xmesa_convert_from_x_visual_type(visinfo->c_class);
+ v->visualType = xmesa_convert_from_x_visual_type(visinfo->c_class);
#endif
v->mesa_visual.visualRating = visualCaveat;
@@ -1421,7 +1421,7 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display,
(void) initialize_visual_and_buffer( v, NULL, 0, 0 );
{
- const int xclass = v->mesa_visual.visualType;
+ const int xclass = v->visualType;
if (xclass == GLX_TRUE_COLOR || xclass == GLX_DIRECT_COLOR) {
red_bits = _mesa_bitcount(GET_REDMASK(v));
green_bits = _mesa_bitcount(GET_GREENMASK(v));
@@ -1481,7 +1481,7 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
{
static GLboolean firstTime = GL_TRUE;
XMesaContext c;
- GLcontext *mesaCtx;
+ struct gl_context *mesaCtx;
struct dd_function_table functions;
TNLcontext *tnl;
@@ -1490,7 +1490,7 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
firstTime = GL_FALSE;
}
- /* 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;
@@ -1501,7 +1501,7 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
_mesa_init_driver_functions(&functions);
xmesa_init_driver_functions(v, &functions);
if (!_mesa_initialize_context(mesaCtx, &v->mesa_visual,
- share_list ? &(share_list->mesa) : (GLcontext *) NULL,
+ share_list ? &(share_list->mesa) : (struct gl_context *) NULL,
&functions, (void *) c)) {
free(c);
return NULL;
@@ -1574,7 +1574,7 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
PUBLIC
void XMesaDestroyContext( XMesaContext c )
{
- GLcontext *mesaCtx = &c->mesa;
+ struct gl_context *mesaCtx = &c->mesa;
#ifdef FX
FXdestroyContext( XMESA_BUFFER(mesaCtx->DrawBuffer) );
@@ -1788,7 +1788,7 @@ XMesaDestroyBuffer(XMesaBuffer b)
/**
- * Query the current window size and update the corresponding GLframebuffer
+ * Query the current window size and update the corresponding struct gl_framebuffer
* and all attached renderbuffers.
* Called when:
* 1. the first time a buffer is bound to a context.
@@ -1804,7 +1804,7 @@ xmesa_check_and_update_buffer_size(XMesaContext xmctx, XMesaBuffer drawBuffer)
xmesa_get_window_size(drawBuffer->display, drawBuffer, &width, &height);
if (drawBuffer->mesa_buffer.Width != width ||
drawBuffer->mesa_buffer.Height != height) {
- GLcontext *ctx = xmctx ? &xmctx->mesa : NULL;
+ struct gl_context *ctx = xmctx ? &xmctx->mesa : NULL;
_mesa_resize_framebuffer(ctx, &(drawBuffer->mesa_buffer), width, height);
}
drawBuffer->mesa_buffer.Initialized = GL_TRUE; /* XXX TEMPORARY? */
@@ -2252,7 +2252,7 @@ unsigned long XMesaDitherColor( XMesaContext xmesa, GLint x, GLint y,
GLfloat red, GLfloat green,
GLfloat blue, GLfloat alpha )
{
- GLcontext *ctx = &xmesa->mesa;
+ struct gl_context *ctx = &xmesa->mesa;
GLint r = (GLint) (red * 255.0F);
GLint g = (GLint) (green * 255.0F);
GLint b = (GLint) (blue * 255.0F);
diff --git a/src/mesa/drivers/x11/xm_buffer.c b/src/mesa/drivers/x11/xm_buffer.c
index e47949750ab..2683bd44d19 100644
--- a/src/mesa/drivers/x11/xm_buffer.c
+++ b/src/mesa/drivers/x11/xm_buffer.c
@@ -251,7 +251,7 @@ xmesa_delete_renderbuffer(struct gl_renderbuffer *rb)
* Called via gl_renderbuffer::AllocStorage()
*/
static GLboolean
-xmesa_alloc_front_storage(GLcontext *ctx, struct gl_renderbuffer *rb,
+xmesa_alloc_front_storage(struct gl_context *ctx, struct gl_renderbuffer *rb,
GLenum internalFormat, GLuint width, GLuint height)
{
struct xmesa_renderbuffer *xrb = xmesa_renderbuffer(rb);
@@ -278,7 +278,7 @@ xmesa_alloc_front_storage(GLcontext *ctx, struct gl_renderbuffer *rb,
* Called via gl_renderbuffer::AllocStorage()
*/
static GLboolean
-xmesa_alloc_back_storage(GLcontext *ctx, struct gl_renderbuffer *rb,
+xmesa_alloc_back_storage(struct gl_context *ctx, struct gl_renderbuffer *rb,
GLenum internalFormat, GLuint width, GLuint height)
{
struct xmesa_renderbuffer *xrb = xmesa_renderbuffer(rb);
@@ -323,7 +323,7 @@ xmesa_alloc_back_storage(GLcontext *ctx, struct gl_renderbuffer *rb,
struct xmesa_renderbuffer *
-xmesa_new_renderbuffer(GLcontext *ctx, GLuint name, const GLvisual *visual,
+xmesa_new_renderbuffer(struct gl_context *ctx, GLuint name, const struct gl_config *visual,
GLboolean backBuffer)
{
struct xmesa_renderbuffer *xrb = CALLOC_STRUCT(xmesa_renderbuffer);
diff --git a/src/mesa/drivers/x11/xm_dd.c b/src/mesa/drivers/x11/xm_dd.c
index 5edafb890b1..acece2025cf 100644
--- a/src/mesa/drivers/x11/xm_dd.c
+++ b/src/mesa/drivers/x11/xm_dd.c
@@ -91,7 +91,7 @@ const int xmesa_kernel1[16] = {
static void
-finish_or_flush( GLcontext *ctx )
+finish_or_flush( struct gl_context *ctx )
{
#ifdef XFree86Server
/* NOT_NEEDED */
@@ -107,7 +107,7 @@ finish_or_flush( GLcontext *ctx )
static void
-clear_color( GLcontext *ctx, const GLfloat color[4] )
+clear_color( struct gl_context *ctx, const GLfloat color[4] )
{
if (ctx->DrawBuffer->Name == 0) {
const XMesaContext xmesa = XMESA_CONTEXT(ctx);
@@ -134,12 +134,12 @@ clear_color( GLcontext *ctx, const GLfloat color[4] )
/* Implements glColorMask() */
static void
-color_mask(GLcontext *ctx,
+color_mask(struct gl_context *ctx,
GLboolean rmask, GLboolean gmask, GLboolean bmask, GLboolean amask)
{
const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaBuffer xmbuf;
- const int xclass = xmesa->xm_visual->mesa_visual.visualType;
+ const int xclass = xmesa->xm_visual->visualType;
(void) amask;
if (ctx->DrawBuffer->Name != 0)
@@ -173,7 +173,7 @@ color_mask(GLcontext *ctx,
* Clear the front or back color buffer, if it's implemented with a pixmap.
*/
static void
-clear_pixmap(GLcontext *ctx, struct xmesa_renderbuffer *xrb,
+clear_pixmap(struct gl_context *ctx, struct xmesa_renderbuffer *xrb,
GLint x, GLint y, GLint width, GLint height)
{
const XMesaContext xmesa = XMESA_CONTEXT(ctx);
@@ -193,7 +193,7 @@ clear_pixmap(GLcontext *ctx, struct xmesa_renderbuffer *xrb,
static void
-clear_8bit_ximage( GLcontext *ctx, struct xmesa_renderbuffer *xrb,
+clear_8bit_ximage( struct gl_context *ctx, struct xmesa_renderbuffer *xrb,
GLint x, GLint y, GLint width, GLint height )
{
const XMesaContext xmesa = XMESA_CONTEXT(ctx);
@@ -206,7 +206,7 @@ clear_8bit_ximage( GLcontext *ctx, struct xmesa_renderbuffer *xrb,
static void
-clear_HPCR_ximage( GLcontext *ctx, struct xmesa_renderbuffer *xrb,
+clear_HPCR_ximage( struct gl_context *ctx, struct xmesa_renderbuffer *xrb,
GLint x, GLint y, GLint width, GLint height )
{
const XMesaContext xmesa = XMESA_CONTEXT(ctx);
@@ -227,7 +227,7 @@ clear_HPCR_ximage( GLcontext *ctx, struct xmesa_renderbuffer *xrb,
static void
-clear_16bit_ximage( GLcontext *ctx, struct xmesa_renderbuffer *xrb,
+clear_16bit_ximage( struct gl_context *ctx, struct xmesa_renderbuffer *xrb,
GLint x, GLint y, GLint width, GLint height)
{
const XMesaContext xmesa = XMESA_CONTEXT(ctx);
@@ -249,7 +249,7 @@ clear_16bit_ximage( GLcontext *ctx, struct xmesa_renderbuffer *xrb,
/* Optimized code provided by Nozomi Ytow <[email protected]> */
static void
-clear_24bit_ximage(GLcontext *ctx, struct xmesa_renderbuffer *xrb,
+clear_24bit_ximage(struct gl_context *ctx, struct xmesa_renderbuffer *xrb,
GLint x, GLint y, GLint width, GLint height)
{
const XMesaContext xmesa = XMESA_CONTEXT(ctx);
@@ -282,7 +282,7 @@ clear_24bit_ximage(GLcontext *ctx, struct xmesa_renderbuffer *xrb,
static void
-clear_32bit_ximage(GLcontext *ctx, struct xmesa_renderbuffer *xrb,
+clear_32bit_ximage(struct gl_context *ctx, struct xmesa_renderbuffer *xrb,
GLint x, GLint y, GLint width, GLint height)
{
const XMesaContext xmesa = XMESA_CONTEXT(ctx);
@@ -326,7 +326,7 @@ clear_32bit_ximage(GLcontext *ctx, struct xmesa_renderbuffer *xrb,
static void
-clear_nbit_ximage(GLcontext *ctx, struct xmesa_renderbuffer *xrb,
+clear_nbit_ximage(struct gl_context *ctx, struct xmesa_renderbuffer *xrb,
GLint x, GLint y, GLint width, GLint height)
{
const XMesaContext xmesa = XMESA_CONTEXT(ctx);
@@ -345,7 +345,7 @@ clear_nbit_ximage(GLcontext *ctx, struct xmesa_renderbuffer *xrb,
static void
-clear_buffers(GLcontext *ctx, GLbitfield buffers)
+clear_buffers(struct gl_context *ctx, GLbitfield buffers)
{
if (ctx->DrawBuffer->Name == 0) {
/* this is a window system framebuffer */
@@ -396,7 +396,7 @@ clear_buffers(GLcontext *ctx, GLbitfield buffers)
* Check if we can do an optimized glDrawPixels into an 8R8G8B visual.
*/
static GLboolean
-can_do_DrawPixels_8R8G8B(GLcontext *ctx, GLenum format, GLenum type)
+can_do_DrawPixels_8R8G8B(struct gl_context *ctx, GLenum format, GLenum type)
{
if (format == GL_BGRA &&
type == GL_UNSIGNED_BYTE &&
@@ -432,7 +432,7 @@ can_do_DrawPixels_8R8G8B(GLcontext *ctx, GLenum format, GLenum type)
* The image format must be GL_BGRA to match the PF_8R8G8B pixel format.
*/
static void
-xmesa_DrawPixels_8R8G8B( GLcontext *ctx,
+xmesa_DrawPixels_8R8G8B( struct gl_context *ctx,
GLint x, GLint y, GLsizei width, GLsizei height,
GLenum format, GLenum type,
const struct gl_pixelstore_attrib *unpack,
@@ -529,7 +529,7 @@ xmesa_DrawPixels_8R8G8B( GLcontext *ctx,
* Check if we can do an optimized glDrawPixels into an 5R6G5B visual.
*/
static GLboolean
-can_do_DrawPixels_5R6G5B(GLcontext *ctx, GLenum format, GLenum type)
+can_do_DrawPixels_5R6G5B(struct gl_context *ctx, GLenum format, GLenum type)
{
if (format == GL_RGB &&
type == GL_UNSIGNED_SHORT_5_6_5 &&
@@ -567,7 +567,7 @@ can_do_DrawPixels_5R6G5B(GLcontext *ctx, GLenum format, GLenum type)
* match the PF_5R6G5B pixel format.
*/
static void
-xmesa_DrawPixels_5R6G5B( GLcontext *ctx,
+xmesa_DrawPixels_5R6G5B( struct gl_context *ctx,
GLint x, GLint y, GLsizei width, GLsizei height,
GLenum format, GLenum type,
const struct gl_pixelstore_attrib *unpack,
@@ -662,7 +662,7 @@ xmesa_DrawPixels_5R6G5B( GLcontext *ctx,
* Determine if we can do an optimized glCopyPixels.
*/
static GLboolean
-can_do_CopyPixels(GLcontext *ctx, GLenum type)
+can_do_CopyPixels(struct gl_context *ctx, GLenum type)
{
if (type == GL_COLOR &&
ctx->_ImageTransferState == 0 && /* no color tables, scale/bias, etc */
@@ -701,7 +701,7 @@ can_do_CopyPixels(GLcontext *ctx, GLenum type)
* We do support copying from one window to another, ala glXMakeCurrentRead.
*/
static void
-xmesa_CopyPixels( GLcontext *ctx,
+xmesa_CopyPixels( struct gl_context *ctx,
GLint srcx, GLint srcy, GLsizei width, GLsizei height,
GLint destx, GLint desty, GLenum type )
{
@@ -740,7 +740,7 @@ xmesa_CopyPixels( GLcontext *ctx,
* return a meaningful GL_RENDERER string.
*/
static const GLubyte *
-get_string( GLcontext *ctx, GLenum name )
+get_string( struct gl_context *ctx, GLenum name )
{
(void) ctx;
switch (name) {
@@ -767,7 +767,7 @@ get_string( GLcontext *ctx, GLenum name )
* dither enable/disable.
*/
static void
-enable( GLcontext *ctx, GLenum pname, GLboolean state )
+enable( struct gl_context *ctx, GLenum pname, GLboolean state )
{
const XMesaContext xmesa = XMESA_CONTEXT(ctx);
@@ -785,7 +785,7 @@ enable( GLcontext *ctx, GLenum pname, GLboolean state )
static void
-clear_color_HPCR_ximage( GLcontext *ctx, const GLfloat color[4] )
+clear_color_HPCR_ximage( struct gl_context *ctx, const GLfloat color[4] )
{
int i;
const XMesaContext xmesa = XMESA_CONTEXT(ctx);
@@ -819,7 +819,7 @@ clear_color_HPCR_ximage( GLcontext *ctx, const GLfloat color[4] )
static void
-clear_color_HPCR_pixmap( GLcontext *ctx, const GLfloat color[4] )
+clear_color_HPCR_pixmap( struct gl_context *ctx, const GLfloat color[4] )
{
int i;
const XMesaContext xmesa = XMESA_CONTEXT(ctx);
@@ -863,7 +863,7 @@ clear_color_HPCR_pixmap( GLcontext *ctx, const GLfloat color[4] )
* flags.
*/
void
-xmesa_update_state( GLcontext *ctx, GLbitfield new_state )
+xmesa_update_state( struct gl_context *ctx, GLbitfield new_state )
{
const XMesaContext xmesa = XMESA_CONTEXT(ctx);
@@ -954,7 +954,7 @@ xmesa_update_state( GLcontext *ctx, GLbitfield new_state )
* texels.
*/
static GLboolean
-test_proxy_teximage(GLcontext *ctx, GLenum target, GLint level,
+test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level,
GLint internalFormat, GLenum format, GLenum type,
GLint width, GLint height, GLint depth, GLint border)
{
@@ -988,7 +988,7 @@ test_proxy_teximage(GLcontext *ctx, GLenum target, GLint level,
* In SW, we don't really compress GL_COMPRESSED_RGB[A] textures!
*/
static gl_format
-choose_tex_format( GLcontext *ctx, GLint internalFormat,
+choose_tex_format( struct gl_context *ctx, GLint internalFormat,
GLenum format, GLenum type )
{
switch (internalFormat) {
@@ -1014,7 +1014,7 @@ choose_tex_format( GLcontext *ctx, GLint internalFormat,
* That problem led to the GLX_MESA_resize_buffers extension.
*/
static void
-xmesa_viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h)
+xmesa_viewport(struct gl_context *ctx, GLint x, GLint y, GLsizei w, GLsizei h)
{
XMesaContext xmctx = XMESA_CONTEXT(ctx);
XMesaBuffer xmdrawbuf = XMESA_BUFFER(ctx->WinSysDrawBuffer);
@@ -1044,7 +1044,7 @@ struct xmesa_query_object
static struct gl_query_object *
-xmesa_new_query_object(GLcontext *ctx, GLuint id)
+xmesa_new_query_object(struct gl_context *ctx, GLuint id)
{
struct xmesa_query_object *q = CALLOC_STRUCT(xmesa_query_object);
if (q) {
@@ -1056,7 +1056,7 @@ xmesa_new_query_object(GLcontext *ctx, GLuint id)
static void
-xmesa_begin_query(GLcontext *ctx, struct gl_query_object *q)
+xmesa_begin_query(struct gl_context *ctx, struct gl_query_object *q)
{
if (q->Target == GL_TIME_ELAPSED_EXT) {
struct xmesa_query_object *xq = (struct xmesa_query_object *) q;
@@ -1083,7 +1083,7 @@ time_diff(const struct timeval *t0, const struct timeval *t1)
static void
-xmesa_end_query(GLcontext *ctx, struct gl_query_object *q)
+xmesa_end_query(struct gl_context *ctx, struct gl_query_object *q)
{
if (q->Target == GL_TIME_ELAPSED_EXT) {
struct xmesa_query_object *xq = (struct xmesa_query_object *) q;
@@ -1175,7 +1175,7 @@ xmesa_init_driver_functions( XMesaVisual xmvisual,
* functions.
* Called during context creation only.
*/
-void xmesa_register_swrast_functions( GLcontext *ctx )
+void xmesa_register_swrast_functions( struct gl_context *ctx )
{
SWcontext *swrast = SWRAST_CONTEXT( ctx );
diff --git a/src/mesa/drivers/x11/xm_line.c b/src/mesa/drivers/x11/xm_line.c
index f643b6d3a76..f03f99f918f 100644
--- a/src/mesa/drivers/x11/xm_line.c
+++ b/src/mesa/drivers/x11/xm_line.c
@@ -54,7 +54,7 @@
*/
#if 000
/* XXX don't use this, it doesn't dither correctly */
-static void draw_points_ANY_pixmap( GLcontext *ctx, const SWvertex *vert )
+static void draw_points_ANY_pixmap( struct gl_context *ctx, const SWvertex *vert )
{
XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
@@ -89,7 +89,7 @@ static void draw_points_ANY_pixmap( GLcontext *ctx, const SWvertex *vert )
* our internal point functions, otherwise fall back to the standard
* swrast functions.
*/
-void xmesa_choose_point( GLcontext *ctx )
+void xmesa_choose_point( struct gl_context *ctx )
{
#if 0
XMesaContext xmesa = XMESA_CONTEXT(ctx);
@@ -546,7 +546,7 @@ void xmesa_choose_point( GLcontext *ctx )
* for the XSetLineAttributes() function call.
*/
static void
-xor_line(GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1)
+xor_line(struct gl_context *ctx, const SWvertex *vert0, const SWvertex *vert1)
{
XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
@@ -578,7 +578,7 @@ xor_line(GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1)
* swrast fallback.
*/
static swrast_line_func
-get_line_func(GLcontext *ctx)
+get_line_func(struct gl_context *ctx)
{
#if CHAN_BITS == 8
SWcontext *swrast = SWRAST_CONTEXT(ctx);
@@ -682,7 +682,7 @@ get_line_func(GLcontext *ctx)
* standard swrast functions.
*/
void
-xmesa_choose_line(GLcontext *ctx)
+xmesa_choose_line(struct gl_context *ctx)
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
diff --git a/src/mesa/drivers/x11/xm_span.c b/src/mesa/drivers/x11/xm_span.c
index c39d87c4516..ab66c5e1f12 100644
--- a/src/mesa/drivers/x11/xm_span.c
+++ b/src/mesa/drivers/x11/xm_span.c
@@ -163,13 +163,13 @@ static unsigned long read_pixel( XMesaDisplay *dpy,
#define PUT_ROW_ARGS \
- GLcontext *ctx, \
+ struct gl_context *ctx, \
struct gl_renderbuffer *rb, \
GLuint n, GLint x, GLint y, \
const void *values, const GLubyte mask[]
#define RGB_SPAN_ARGS \
- GLcontext *ctx, \
+ struct gl_context *ctx, \
struct gl_renderbuffer *rb, \
GLuint n, GLint x, GLint y, \
const void *values, const GLubyte mask[]
@@ -2242,7 +2242,7 @@ static void put_row_rgb_GRAYSCALE8_ximage( RGB_SPAN_ARGS )
#define PUT_VALUES_ARGS \
- GLcontext *ctx, struct gl_renderbuffer *rb, \
+ struct gl_context *ctx, struct gl_renderbuffer *rb, \
GLuint n, const GLint x[], const GLint y[], \
const void *values, const GLubyte mask[]
@@ -2829,7 +2829,7 @@ static void put_values_GRAYSCALE8_ximage( PUT_VALUES_ARGS )
/**********************************************************************/
#define PUT_MONO_ROW_ARGS \
- GLcontext *ctx, struct gl_renderbuffer *rb, \
+ struct gl_context *ctx, struct gl_renderbuffer *rb, \
GLuint n, GLint x, GLint y, const void *value, \
const GLubyte mask[]
@@ -3267,7 +3267,7 @@ static void put_mono_row_DITHER_5R6G5B_ximage( PUT_MONO_ROW_ARGS )
/**********************************************************************/
#define PUT_MONO_VALUES_ARGS \
- GLcontext *ctx, struct gl_renderbuffer *rb, \
+ struct gl_context *ctx, struct gl_renderbuffer *rb, \
GLuint n, const GLint x[], const GLint y[], \
const void *value, const GLubyte mask[]
@@ -3773,7 +3773,7 @@ static void put_values_ci_ximage( PUT_VALUES_ARGS )
* else return number of pixels to skip in the destination array.
*/
static int
-clip_for_xgetimage(GLcontext *ctx, XMesaPixmap pixmap, GLuint *n, GLint *x, GLint *y)
+clip_for_xgetimage(struct gl_context *ctx, XMesaPixmap pixmap, GLuint *n, GLint *x, GLint *y)
{
XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaBuffer source = XMESA_BUFFER(ctx->DrawBuffer);
@@ -3813,7 +3813,7 @@ clip_for_xgetimage(GLcontext *ctx, XMesaPixmap pixmap, GLuint *n, GLint *x, GLin
* Read a horizontal span of color-index pixels.
*/
static void
-get_row_ci(GLcontext *ctx, struct gl_renderbuffer *rb,
+get_row_ci(struct gl_context *ctx, struct gl_renderbuffer *rb,
GLuint n, GLint x, GLint y, void *values)
{
GLuint *index = (GLuint *) values;
@@ -3870,7 +3870,7 @@ get_row_ci(GLcontext *ctx, struct gl_renderbuffer *rb,
* Read a horizontal span of color pixels.
*/
static void
-get_row_rgba(GLcontext *ctx, struct gl_renderbuffer *rb,
+get_row_rgba(struct gl_context *ctx, struct gl_renderbuffer *rb,
GLuint n, GLint x, GLint y, void *values)
{
GLubyte (*rgba)[4] = (GLubyte (*)[4]) values;
@@ -4272,7 +4272,7 @@ get_row_rgba(GLcontext *ctx, struct gl_renderbuffer *rb,
* Read an array of color index pixels.
*/
static void
-get_values_ci(GLcontext *ctx, struct gl_renderbuffer *rb,
+get_values_ci(struct gl_context *ctx, struct gl_renderbuffer *rb,
GLuint n, const GLint x[], const GLint y[], void *values)
{
GLuint *indx = (GLuint *) values;
@@ -4296,7 +4296,7 @@ get_values_ci(GLcontext *ctx, struct gl_renderbuffer *rb,
static void
-get_values_rgba(GLcontext *ctx, struct gl_renderbuffer *rb,
+get_values_rgba(struct gl_context *ctx, struct gl_renderbuffer *rb,
GLuint n, const GLint x[], const GLint y[], void *values)
{
GLubyte (*rgba)[4] = (GLubyte (*)[4]) values;
diff --git a/src/mesa/drivers/x11/xm_tri.c b/src/mesa/drivers/x11/xm_tri.c
index a6efb35e3c3..98dece113de 100644
--- a/src/mesa/drivers/x11/xm_tri.c
+++ b/src/mesa/drivers/x11/xm_tri.c
@@ -1448,7 +1448,7 @@ do { \
* swrast fallback.
*/
static swrast_tri_func
-get_triangle_func(GLcontext *ctx)
+get_triangle_func(struct gl_context *ctx)
{
#if CHAN_BITS == 8
SWcontext *swrast = SWRAST_CONTEXT(ctx);
@@ -1644,7 +1644,7 @@ get_triangle_func(GLcontext *ctx)
* of our internal tri functions, otherwise fall back to the
* standard swrast functions.
*/
-void xmesa_choose_triangle( GLcontext *ctx )
+void xmesa_choose_triangle( struct gl_context *ctx )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
diff --git a/src/mesa/drivers/x11/xmesaP.h b/src/mesa/drivers/x11/xmesaP.h
index e0a6908228d..5d34b430cb6 100644
--- a/src/mesa/drivers/x11/xmesaP.h
+++ b/src/mesa/drivers/x11/xmesaP.h
@@ -54,7 +54,7 @@ struct xmesa_renderbuffer;
/* Function pointer for clearing color buffers */
-typedef void (*ClearFunc)( GLcontext *ctx, struct xmesa_renderbuffer *xrb,
+typedef void (*ClearFunc)( struct gl_context *ctx, struct xmesa_renderbuffer *xrb,
GLint x, GLint y, GLint width, GLint height );
@@ -80,12 +80,14 @@ enum pixel_format {
/**
- * Visual inforation, derived from GLvisual.
+ * Visual inforation, derived from struct gl_config.
* Basically corresponds to an XVisualInfo.
*/
struct xmesa_visual {
- GLvisual mesa_visual; /* Device independent visual parameters */
+ struct gl_config mesa_visual; /* Device independent visual parameters */
XMesaDisplay *display; /* The X11 display */
+ int screen, visualID;
+ int visualType;
#ifdef XFree86Server
GLint ColormapEntries;
GLint nplanes;
@@ -127,11 +129,11 @@ struct xmesa_visual {
/**
- * Context info, derived from GLcontext.
+ * Context info, derived from struct gl_context.
* Basically corresponds to a GLXContext.
*/
struct xmesa_context {
- GLcontext mesa; /* the core library context (containment) */
+ struct gl_context mesa; /* the core library context (containment) */
XMesaVisual xm_visual; /* Describes the buffers */
XMesaBuffer xm_buffer; /* current span/point/line/triangle buffer */
@@ -204,7 +206,7 @@ struct xmesa_renderbuffer
* Basically corresponds to a GLXDrawable.
*/
struct xmesa_buffer {
- GLframebuffer mesa_buffer; /* depth, stencil, accum, etc buffers */
+ struct gl_framebuffer mesa_buffer; /* depth, stencil, accum, etc buffers */
/* This MUST BE FIRST! */
GLboolean wasCurrent; /* was ever the current buffer? */
XMesaVisual xm_visual; /* the X/Mesa visual */
@@ -494,7 +496,7 @@ extern const int xmesa_kernel1[16];
*/
extern struct xmesa_renderbuffer *
-xmesa_new_renderbuffer(GLcontext *ctx, GLuint name, const GLvisual *visual,
+xmesa_new_renderbuffer(struct gl_context *ctx, GLuint name, const struct gl_config *visual,
GLboolean backBuffer);
extern void
@@ -504,7 +506,7 @@ extern XMesaBuffer
xmesa_find_buffer(XMesaDisplay *dpy, XMesaColormap cmap, XMesaBuffer notThis);
extern unsigned long
-xmesa_color_to_pixel( GLcontext *ctx,
+xmesa_color_to_pixel( struct gl_context *ctx,
GLubyte r, GLubyte g, GLubyte b, GLubyte a,
GLuint pixelFormat );
@@ -520,7 +522,7 @@ xmesa_init_driver_functions( XMesaVisual xmvisual,
struct dd_function_table *driver );
extern void
-xmesa_update_state( GLcontext *ctx, GLbitfield new_state );
+xmesa_update_state( struct gl_context *ctx, GLbitfield new_state );
extern void
xmesa_set_renderbuffer_funcs(struct xmesa_renderbuffer *xrb,
@@ -541,22 +543,22 @@ xmesa_renderbuffer(struct gl_renderbuffer *rb)
/**
- * Return pointer to XMesaContext corresponding to a Mesa GLcontext.
+ * Return pointer to XMesaContext corresponding to a Mesa struct gl_context.
* Since we're using structure containment, it's just a cast!.
*/
static INLINE XMesaContext
-XMESA_CONTEXT(GLcontext *ctx)
+XMESA_CONTEXT(struct gl_context *ctx)
{
return (XMesaContext) ctx;
}
/**
- * Return pointer to XMesaBuffer corresponding to a Mesa GLframebuffer.
+ * Return pointer to XMesaBuffer corresponding to a Mesa struct gl_framebuffer.
* Since we're using structure containment, it's just a cast!.
*/
static INLINE XMesaBuffer
-XMESA_BUFFER(GLframebuffer *b)
+XMESA_BUFFER(struct gl_framebuffer *b)
{
return (XMesaBuffer) b;
}
@@ -565,12 +567,12 @@ XMESA_BUFFER(GLframebuffer *b)
/* Plugged into the software rasterizer. Try to use internal
* swrast-style point, line and triangle functions.
*/
-extern void xmesa_choose_point( GLcontext *ctx );
-extern void xmesa_choose_line( GLcontext *ctx );
-extern void xmesa_choose_triangle( GLcontext *ctx );
+extern void xmesa_choose_point( struct gl_context *ctx );
+extern void xmesa_choose_line( struct gl_context *ctx );
+extern void xmesa_choose_triangle( struct gl_context *ctx );
-extern void xmesa_register_swrast_functions( GLcontext *ctx );
+extern void xmesa_register_swrast_functions( struct gl_context *ctx );
diff --git a/src/mesa/drivers/x11/xmesa_x.h b/src/mesa/drivers/x11/xmesa_x.h
index 865bab4313b..ea6cb3f24e1 100644
--- a/src/mesa/drivers/x11/xmesa_x.h
+++ b/src/mesa/drivers/x11/xmesa_x.h
@@ -79,7 +79,7 @@ typedef XColor XMesaColor;
#define GET_GREENMASK(__v) __v->mesa_visual.greenMask
#define GET_BLUEMASK(__v) __v->mesa_visual.blueMask
#define GET_VISUAL_DEPTH(__v) __v->visinfo->depth
-#define GET_BLACK_PIXEL(__v) BlackPixel(__v->display, __v->mesa_visual.screen)
+#define GET_BLACK_PIXEL(__v) BlackPixel(__v->display, __v->screen)
#define CHECK_BYTE_ORDER(__v) host_byte_order()==ImageByteOrder(__v->display)
#define CHECK_FOR_HPCR(__v) XInternAtom(__v->display, "_HP_RGB_SMOOTH_MAP_LIST", True)