summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2003-04-01 17:28:10 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2003-04-01 17:28:10 +0000
commit1e24d3318df57b36e3b68695ff64b4b8bd822c9e (patch)
treef0cdd861ec97d7dd61fd4c3b28f44cced5f4346b
parenta3f137094cd965d27e1b088499dd609b81a91906 (diff)
use structure containment to derive xmesa_context from GLcontext
-rw-r--r--src/mesa/drivers/x11/fakeglx.c4
-rw-r--r--src/mesa/drivers/x11/xm_api.c83
-rw-r--r--src/mesa/drivers/x11/xm_dd.c43
-rw-r--r--src/mesa/drivers/x11/xm_line.c44
-rw-r--r--src/mesa/drivers/x11/xm_span.c264
-rw-r--r--src/mesa/drivers/x11/xm_tri.c92
-rw-r--r--src/mesa/drivers/x11/xmesaP.h13
7 files changed, 279 insertions, 264 deletions
diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c
index 96b1ee60f9..59f2ab04b9 100644
--- a/src/mesa/drivers/x11/fakeglx.c
+++ b/src/mesa/drivers/x11/fakeglx.c
@@ -1,4 +1,4 @@
-/* $Id: fakeglx.c,v 1.81 2003/03/24 23:41:10 brianp Exp $ */
+/* $Id: fakeglx.c,v 1.82 2003/04/01 17:28:10 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -1424,7 +1424,7 @@ Fake_glXCopyContext( Display *dpy, GLXContext src, GLXContext dst,
XMesaContext xm_src = fakeSrc->xmesaContext;
XMesaContext xm_dst = fakeDst->xmesaContext;
(void) dpy;
- _mesa_copy_context( xm_src->gl_ctx, xm_dst->gl_ctx, (GLuint) mask );
+ _mesa_copy_context( &(xm_src->mesa), &(xm_dst->mesa), (GLuint) mask );
}
diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c
index 80db1212da..ec32efd5f0 100644
--- a/src/mesa/drivers/x11/xm_api.c
+++ b/src/mesa/drivers/x11/xm_api.c
@@ -1,4 +1,4 @@
-/* $Id: xm_api.c,v 1.54 2003/03/01 01:50:24 brianp Exp $ */
+/* $Id: xm_api.c,v 1.55 2003/04/01 17:28:11 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -74,6 +74,7 @@
#include "mtypes.h"
#include "macros.h"
#include "texformat.h"
+#include "texobj.h"
#include "texstore.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
@@ -1594,8 +1595,8 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
{
static GLboolean firstTime = GL_TRUE;
XMesaContext c;
- GLcontext *ctx;
GLboolean direct = GL_TRUE; /* not really */
+ GLcontext *mesaCtx;
if (firstTime) {
_glthread_INIT_MUTEX(_xmesa_lock);
@@ -1607,17 +1608,26 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
return NULL;
}
- ctx = c->gl_ctx = _mesa_create_context( &v->mesa_visual,
- share_list ? share_list->gl_ctx : (GLcontext *) NULL,
- (void *) c, direct);
- if (!c->gl_ctx) {
+ mesaCtx = &(c->mesa);
+
+ /* Setup these pointers here since they're using for making the default
+ * and proxy texture objects. Actually, we don't really need to do
+ * this since we're using the default fallback functions which
+ * _mesa_initialize_context() would plug in if needed.
+ */
+ mesaCtx->Driver.NewTextureObject = _mesa_new_texture_object;
+ mesaCtx->Driver.DeleteTexture = _mesa_delete_texture_object;
+
+ if (!_mesa_initialize_context(mesaCtx, &v->mesa_visual,
+ share_list ? &(share_list->mesa) : (GLcontext *) NULL,
+ (void *) c, direct)) {
FREE(c);
return NULL;
}
- _mesa_enable_sw_extensions(ctx);
- _mesa_enable_1_3_extensions(ctx);
- _mesa_enable_1_4_extensions(ctx);
+ _mesa_enable_sw_extensions(mesaCtx);
+ _mesa_enable_1_3_extensions(mesaCtx);
+ _mesa_enable_1_4_extensions(mesaCtx);
if (CHECK_BYTE_ORDER(v)) {
c->swapbytes = GL_FALSE;
@@ -1633,20 +1643,20 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
c->display = v->display;
c->pixelformat = v->dithered_pf; /* Dithering is enabled by default */
- ctx->Driver.UpdateState = xmesa_update_state;
+ mesaCtx->Driver.UpdateState = xmesa_update_state;
/* Initialize the software rasterizer and helper modules.
*/
- _swrast_CreateContext( ctx );
- _ac_CreateContext( ctx );
- _tnl_CreateContext( ctx );
- _swsetup_CreateContext( ctx );
+ _swrast_CreateContext( mesaCtx );
+ _ac_CreateContext( mesaCtx );
+ _tnl_CreateContext( mesaCtx );
+ _swsetup_CreateContext( mesaCtx );
- xmesa_register_swrast_functions( ctx );
+ xmesa_register_swrast_functions( mesaCtx );
/* Set up some constant pointers:
*/
- xmesa_init_pointers( ctx );
+ xmesa_init_pointers( mesaCtx );
return c;
}
@@ -1656,17 +1666,16 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
void XMesaDestroyContext( XMesaContext c )
{
+ GLcontext *mesaCtx = &c->mesa;
#ifdef FX
if (c->xm_draw_buffer && c->xm_buffer->FXctx)
fxMesaDestroyContext(c->xm_draw_buffer->FXctx);
#endif
- if (c->gl_ctx) {
- _swsetup_DestroyContext( c->gl_ctx );
- _swrast_DestroyContext( c->gl_ctx );
- _tnl_DestroyContext( c->gl_ctx );
- _ac_DestroyContext( c->gl_ctx );
- _mesa_destroy_context( c->gl_ctx );
- }
+ _swsetup_DestroyContext( mesaCtx );
+ _swrast_DestroyContext( mesaCtx );
+ _tnl_DestroyContext( mesaCtx );
+ _ac_DestroyContext( mesaCtx );
+ _mesa_destroy_context( mesaCtx );
FREE( c );
}
@@ -1785,10 +1794,10 @@ XMesaBuffer XMesaCreateWindowBuffer2( XMesaVisual v, XMesaWindow w,
attribs[numAttribs++] = FXMESA_ALPHA_SIZE;
attribs[numAttribs++] = 1;
}
- if (c->gl_ctx) {
+ if (1) {
#define FXMESA_SHARE_CONTEXT 990099 /* keep in sync with fxapi.c! */
attribs[numAttribs++] = FXMESA_SHARE_CONTEXT;
- attribs[numAttribs++] = (int) c->gl_ctx;
+ attribs[numAttribs++] = (int) &(c->mesa);
}
attribs[numAttribs++] = FXMESA_NONE;
@@ -2031,7 +2040,7 @@ GLboolean XMesaMakeCurrent2( XMesaContext c, XMesaBuffer drawBuffer,
return GL_TRUE;
}
#endif
- if (c->gl_ctx == _mesa_get_current_context()
+ if (&(c->mesa) == _mesa_get_current_context()
&& c->xm_draw_buffer == drawBuffer
&& c->xm_read_buffer == readBuffer
&& c->xm_draw_buffer->wasCurrent) {
@@ -2043,15 +2052,15 @@ GLboolean XMesaMakeCurrent2( XMesaContext c, XMesaBuffer drawBuffer,
c->xm_read_buffer = readBuffer;
c->xm_buffer = drawBuffer;
- _mesa_make_current2(c->gl_ctx,
+ _mesa_make_current2(&(c->mesa),
&drawBuffer->mesa_buffer,
&readBuffer->mesa_buffer);
- if (c->gl_ctx->Viewport.Width == 0) {
+ if (c->mesa.Viewport.Width == 0) {
/* initialize viewport to window size */
_mesa_Viewport( 0, 0, drawBuffer->width, drawBuffer->height );
- c->gl_ctx->Scissor.Width = drawBuffer->width;
- c->gl_ctx->Scissor.Height = drawBuffer->height;
+ c->mesa.Scissor.Width = drawBuffer->width;
+ c->mesa.Scissor.Height = drawBuffer->height;
}
if (c->xm_visual->mesa_visual.rgbMode) {
@@ -2093,7 +2102,7 @@ XMesaContext XMesaGetCurrentContext( void )
{
GET_CURRENT_CONTEXT(ctx);
if (ctx) {
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ XMesaContext xmesa = XMESA_CONTEXT(ctx);
return xmesa;
}
else {
@@ -2106,7 +2115,7 @@ XMesaBuffer XMesaGetCurrentBuffer( void )
{
GET_CURRENT_CONTEXT(ctx);
if (ctx) {
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ XMesaContext xmesa = XMESA_CONTEXT(ctx);
return xmesa->xm_draw_buffer;
}
else {
@@ -2120,7 +2129,7 @@ XMesaBuffer XMesaGetCurrentReadBuffer( void )
{
GET_CURRENT_CONTEXT(ctx);
if (ctx) {
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ XMesaContext xmesa = XMESA_CONTEXT(ctx);
return xmesa->xm_read_buffer;
}
else {
@@ -2132,8 +2141,8 @@ XMesaBuffer XMesaGetCurrentReadBuffer( void )
GLboolean XMesaForceCurrent(XMesaContext c)
{
if (c) {
- if (c->gl_ctx != _mesa_get_current_context()) {
- _mesa_make_current(c->gl_ctx, &c->xm_draw_buffer->mesa_buffer);
+ if (&(c->mesa) != _mesa_get_current_context()) {
+ _mesa_make_current(&(c->mesa), &c->xm_draw_buffer->mesa_buffer);
}
}
else {
@@ -2170,7 +2179,7 @@ GLboolean XMesaSetFXmode( GLint mode )
return GL_FALSE;
}
if (ctx) {
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ XMesaContext xmesa = XMESA_CONTEXT(ctx);
if (mode == XMESA_FX_WINDOW) {
if (xmesa->xm_draw_buffer->FXisHackUsable) {
FX_grSstControl(GR_CONTROL_DEACTIVATE);
@@ -2209,7 +2218,7 @@ static void FXgetImage( XMesaBuffer b )
int xpos, ypos;
XMesaWindow root;
unsigned int bw, depth, width, height;
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ XMesaContext xmesa = XMESA_CONTEXT(ctx);
#ifdef XFree86Server
x = b->frontbuffer->x;
diff --git a/src/mesa/drivers/x11/xm_dd.c b/src/mesa/drivers/x11/xm_dd.c
index 3aa33a58f3..eec0d8ad32 100644
--- a/src/mesa/drivers/x11/xm_dd.c
+++ b/src/mesa/drivers/x11/xm_dd.c
@@ -1,4 +1,4 @@
-/* $Id: xm_dd.c,v 1.46 2003/04/01 16:41:58 brianp Exp $ */
+/* $Id: xm_dd.c,v 1.47 2003/04/01 17:28:11 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -98,7 +98,7 @@ finish( GLcontext *ctx )
#ifdef XFree86Server
/* NOT_NEEDED */
#else
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
if (xmesa) {
_glthread_LOCK_MUTEX(_xmesa_lock);
XSync( xmesa->display, False );
@@ -114,7 +114,7 @@ flush( GLcontext *ctx )
#ifdef XFree86Server
/* NOT_NEEDED */
#else
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
if (xmesa) {
_glthread_LOCK_MUTEX(_xmesa_lock);
XFlush( xmesa->display );
@@ -136,7 +136,7 @@ set_buffer( GLcontext *ctx, GLframebuffer *buffer, GLuint bufferBit )
* GLframebuffer is the first member in a XMesaBuffer struct.
*/
XMesaBuffer target = (XMesaBuffer) buffer;
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
/* This assignment tells the span/point/line/triangle functions
* which XMesaBuffer to use.
@@ -176,7 +176,7 @@ set_buffer( GLcontext *ctx, GLframebuffer *buffer, GLuint bufferBit )
static void
clear_index( GLcontext *ctx, GLuint index )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
xmesa->clearpixel = (unsigned long) index;
XMesaSetForeground( xmesa->display, xmesa->xm_draw_buffer->cleargc,
(unsigned long) index );
@@ -186,7 +186,7 @@ clear_index( GLcontext *ctx, GLuint index )
static void
clear_color( GLcontext *ctx, const GLfloat color[4] )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[0], color[0]);
CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[1], color[1]);
CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[2], color[2]);
@@ -209,7 +209,7 @@ clear_color( GLcontext *ctx, const GLfloat color[4] )
static void
index_mask( GLcontext *ctx, GLuint mask )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
if (xmesa->xm_draw_buffer->buffer != XIMAGE) {
unsigned long m;
if (mask==0xffffffff) {
@@ -229,7 +229,7 @@ static void
color_mask(GLcontext *ctx,
GLboolean rmask, GLboolean gmask, GLboolean bmask, GLboolean amask)
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
int xclass = GET_VISUAL_CLASS(xmesa->xm_visual);
(void) amask;
@@ -260,7 +260,7 @@ static void
clear_front_pixmap( GLcontext *ctx, GLboolean all,
GLint x, GLint y, GLint width, GLint height )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
if (all) {
XMesaFillRectangle( xmesa->display, xmesa->xm_draw_buffer->frontbuffer,
xmesa->xm_draw_buffer->cleargc,
@@ -281,7 +281,7 @@ static void
clear_back_pixmap( GLcontext *ctx, GLboolean all,
GLint x, GLint y, GLint width, GLint height )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
if (all) {
XMesaFillRectangle( xmesa->display, xmesa->xm_draw_buffer->backpixmap,
xmesa->xm_draw_buffer->cleargc,
@@ -302,7 +302,7 @@ static void
clear_8bit_ximage( GLcontext *ctx, GLboolean all,
GLint x, GLint y, GLint width, GLint height )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
if (all) {
size_t n = xmesa->xm_draw_buffer->backimage->bytes_per_line
* xmesa->xm_draw_buffer->backimage->height;
@@ -322,7 +322,7 @@ static void
clear_HPCR_ximage( GLcontext *ctx, GLboolean all,
GLint x, GLint y, GLint width, GLint height )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
if (all) {
GLint i, c16 = (xmesa->xm_draw_buffer->backimage->bytes_per_line>>4)<<4;
GLubyte *ptr = (GLubyte *)xmesa->xm_draw_buffer->backimage->data;
@@ -379,7 +379,7 @@ static void
clear_16bit_ximage( GLcontext *ctx, GLboolean all,
GLint x, GLint y, GLint width, GLint height )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
register GLuint pixel = (GLuint) xmesa->clearpixel;
if (xmesa->swapbytes) {
pixel = ((pixel >> 8) & 0x00ff) | ((pixel << 8) & 0xff00);
@@ -424,7 +424,7 @@ static void
clear_24bit_ximage( GLcontext *ctx, GLboolean all,
GLint x, GLint y, GLint width, GLint height )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
const GLubyte r = xmesa->clearcolor[0];
const GLubyte g = xmesa->clearcolor[1];
const GLubyte b = xmesa->clearcolor[2];
@@ -634,7 +634,7 @@ static void
clear_32bit_ximage( GLcontext *ctx, GLboolean all,
GLint x, GLint y, GLint width, GLint height )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
register GLuint pixel = (GLuint) xmesa->clearpixel;
if (xmesa->swapbytes) {
pixel = ((pixel >> 24) & 0x000000ff)
@@ -671,7 +671,7 @@ static void
clear_nbit_ximage( GLcontext *ctx, GLboolean all,
GLint x, GLint y, GLint width, GLint height )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaImage *img = xmesa->xm_draw_buffer->backimage;
if (all) {
register int i, j;
@@ -701,7 +701,7 @@ static void
clear_buffers( GLcontext *ctx, GLbitfield mask,
GLboolean all, GLint x, GLint y, GLint width, GLint height )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
const GLuint *colorMask = (GLuint *) &ctx->Color.ColorMask;
if ((mask & (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT)) &&
@@ -790,7 +790,7 @@ drawpixels_8R8G8B( GLcontext *ctx,
const struct gl_pixelstore_attrib *unpack,
const GLvoid *pixels )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_draw_buffer->buffer;
XMesaGC gc = xmesa->xm_draw_buffer->gc;
@@ -860,7 +860,7 @@ get_string( GLcontext *ctx, GLenum name )
static void
enable( GLcontext *ctx, GLenum pname, GLboolean state )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
switch (pname) {
case GL_DITHER:
@@ -877,7 +877,7 @@ enable( GLcontext *ctx, GLenum pname, GLboolean state )
void xmesa_update_state( GLcontext *ctx, GLuint new_state )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
/* Propogate statechange information to swrast and swrast_setup
* modules. The X11 driver has no internal GL-dependent state.
@@ -965,9 +965,6 @@ void xmesa_init_pointers( GLcontext *ctx )
ctx->Driver.CopyTexSubImage2D = _swrast_copy_texsubimage2d;
ctx->Driver.CopyTexSubImage3D = _swrast_copy_texsubimage3d;
- ctx->Driver.NewTextureObject = _mesa_new_texture_object;
- ctx->Driver.DeleteTexture = _mesa_delete_texture_object;
-
ctx->Driver.CompressedTexImage1D = _mesa_store_compressed_teximage1d;
ctx->Driver.CompressedTexImage2D = _mesa_store_compressed_teximage2d;
ctx->Driver.CompressedTexImage3D = _mesa_store_compressed_teximage3d;
diff --git a/src/mesa/drivers/x11/xm_line.c b/src/mesa/drivers/x11/xm_line.c
index 7b629f0b49..de007ea9cb 100644
--- a/src/mesa/drivers/x11/xm_line.c
+++ b/src/mesa/drivers/x11/xm_line.c
@@ -1,4 +1,4 @@
-/* $Id: xm_line.c,v 1.23 2003/03/01 01:50:24 brianp Exp $ */
+/* $Id: xm_line.c,v 1.24 2003/04/01 17:28:12 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -58,7 +58,7 @@
/* XXX don't use this, it doesn't dither correctly */
static void draw_points_ANY_pixmap( GLcontext *ctx, const SWvertex *vert )
{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -94,7 +94,7 @@ static void draw_points_ANY_pixmap( GLcontext *ctx, const SWvertex *vert )
void xmesa_choose_point( GLcontext *ctx )
{
#if 0
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ XMesaContext xmesa = XMESA_CONTEXT(ctx);
SWcontext *swrast = SWRAST_CONTEXT(ctx);
if (ctx->RenderMode == GL_RENDER
@@ -124,7 +124,7 @@ void xmesa_choose_point( GLcontext *ctx )
*/
#define NAME flat_TRUECOLOR_line
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
const GLubyte *color = vert1->color; \
XMesaImage *img = xmesa->xm_buffer->backimage; \
unsigned long pixel; \
@@ -140,7 +140,7 @@ void xmesa_choose_point( GLcontext *ctx )
*/
#define NAME flat_8A8B8G8R_line
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
const GLubyte *color = vert1->color; \
GLuint pixel = PACK_8B8G8R( color[0], color[1], color[2] );
#define PIXEL_TYPE GLuint
@@ -157,7 +157,7 @@ void xmesa_choose_point( GLcontext *ctx )
*/
#define NAME flat_8R8G8B_line
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
const GLubyte *color = vert1->color; \
GLuint pixel = PACK_8R8G8B( color[0], color[1], color[2] );
#define PIXEL_TYPE GLuint
@@ -174,7 +174,7 @@ void xmesa_choose_point( GLcontext *ctx )
*/
#define NAME flat_8R8G8B24_line
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
const GLubyte *color = vert1->color;
#define PIXEL_TYPE bgr_t
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
@@ -194,7 +194,7 @@ void xmesa_choose_point( GLcontext *ctx )
*/
#define NAME flat_5R6G5B_line
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
const GLubyte *color = vert1->color; \
GLushort pixel = PACK_5R6G5B( color[0], color[1], color[2] );
#define PIXEL_TYPE GLushort
@@ -211,7 +211,7 @@ void xmesa_choose_point( GLcontext *ctx )
*/
#define NAME flat_DITHER_5R6G5B_line
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
const GLubyte *color = vert1->color;
#define PIXEL_TYPE GLushort
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
@@ -228,7 +228,7 @@ void xmesa_choose_point( GLcontext *ctx )
*/
#define NAME flat_DITHER8_line
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
const GLubyte *color = vert1->color; \
GLint r = color[0], g = color[1], b = color[2]; \
DITHER_SETUP;
@@ -246,7 +246,7 @@ void xmesa_choose_point( GLcontext *ctx )
*/
#define NAME flat_LOOKUP8_line
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
const GLubyte *color = vert1->color; \
GLubyte pixel; \
LOOKUP_SETUP; \
@@ -265,7 +265,7 @@ void xmesa_choose_point( GLcontext *ctx )
*/
#define NAME flat_HPCR_line
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
const GLubyte *color = vert1->color; \
GLint r = color[0], g = color[1], b = color[2];
#define PIXEL_TYPE GLubyte
@@ -283,7 +283,7 @@ void xmesa_choose_point( GLcontext *ctx )
*/
#define NAME flat_TRUECOLOR_z_line
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
const GLubyte *color = vert1->color; \
XMesaImage *img = xmesa->xm_buffer->backimage; \
unsigned long pixel; \
@@ -305,7 +305,7 @@ void xmesa_choose_point( GLcontext *ctx )
*/
#define NAME flat_8A8B8G8R_z_line
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
const GLubyte *color = vert1->color; \
GLuint pixel = PACK_8B8G8R( color[0], color[1], color[2] );
#define INTERP_Z 1
@@ -328,7 +328,7 @@ void xmesa_choose_point( GLcontext *ctx )
*/
#define NAME flat_8R8G8B_z_line
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
const GLubyte *color = vert1->color; \
GLuint pixel = PACK_8R8G8B( color[0], color[1], color[2] );
#define INTERP_Z 1
@@ -351,7 +351,7 @@ void xmesa_choose_point( GLcontext *ctx )
*/
#define NAME flat_8R8G8B24_z_line
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
const GLubyte *color = vert1->color;
#define INTERP_Z 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
@@ -375,7 +375,7 @@ void xmesa_choose_point( GLcontext *ctx )
*/
#define NAME flat_5R6G5B_z_line
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
const GLubyte *color = vert1->color; \
GLushort pixel = PACK_5R6G5B( color[0], color[1], color[2] );
#define INTERP_Z 1
@@ -398,7 +398,7 @@ void xmesa_choose_point( GLcontext *ctx )
*/
#define NAME flat_DITHER_5R6G5B_z_line
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
const GLubyte *color = vert1->color;
#define INTERP_Z 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
@@ -420,7 +420,7 @@ void xmesa_choose_point( GLcontext *ctx )
*/
#define NAME flat_DITHER8_z_line
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
const GLubyte *color = vert1->color; \
GLint r = color[0], g = color[1], b = color[2]; \
DITHER_SETUP;
@@ -444,7 +444,7 @@ void xmesa_choose_point( GLcontext *ctx )
*/
#define NAME flat_LOOKUP8_z_line
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
const GLubyte *color = vert1->color; \
GLubyte pixel; \
LOOKUP_SETUP; \
@@ -469,7 +469,7 @@ void xmesa_choose_point( GLcontext *ctx )
*/
#define NAME flat_HPCR_z_line
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
const GLubyte *color = vert1->color; \
GLint r = color[0], g = color[1], b = color[2];
#define INTERP_Z 1
@@ -489,7 +489,7 @@ void xmesa_choose_point( GLcontext *ctx )
static swrast_line_func get_line_func( GLcontext *ctx )
{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ XMesaContext xmesa = XMESA_CONTEXT(ctx);
SWcontext *swrast = SWRAST_CONTEXT(ctx);
int depth = GET_VISUAL_DEPTH(xmesa->xm_visual);
diff --git a/src/mesa/drivers/x11/xm_span.c b/src/mesa/drivers/x11/xm_span.c
index 40318c02dc..ce3cd0401e 100644
--- a/src/mesa/drivers/x11/xm_span.c
+++ b/src/mesa/drivers/x11/xm_span.c
@@ -1,4 +1,4 @@
-/* $Id: xm_span.c,v 1.19 2003/02/17 16:35:59 brianp Exp $ */
+/* $Id: xm_span.c,v 1.20 2003/04/01 17:28:12 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -182,7 +182,7 @@ static unsigned long read_pixel( XMesaDisplay *dpy,
*/
static void write_span_TRUECOLOR_pixmap( RGBA_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -219,7 +219,7 @@ static void write_span_TRUECOLOR_pixmap( RGBA_SPAN_ARGS )
*/
static void write_span_rgb_TRUECOLOR_pixmap( RGB_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -253,7 +253,7 @@ static void write_span_rgb_TRUECOLOR_pixmap( RGB_SPAN_ARGS )
*/
static void write_span_TRUEDITHER_pixmap( RGBA_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -286,7 +286,7 @@ static void write_span_TRUEDITHER_pixmap( RGBA_SPAN_ARGS )
*/
static void write_span_rgb_TRUEDITHER_pixmap( RGB_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -320,7 +320,7 @@ static void write_span_rgb_TRUEDITHER_pixmap( RGB_SPAN_ARGS )
*/
static void write_span_8A8B8G8R_pixmap( RGBA_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -352,7 +352,7 @@ static void write_span_8A8B8G8R_pixmap( RGBA_SPAN_ARGS )
*/
static void write_span_rgb_8A8B8G8R_pixmap( RGB_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -384,7 +384,7 @@ static void write_span_rgb_8A8B8G8R_pixmap( RGB_SPAN_ARGS )
*/
static void write_span_8R8G8B_pixmap( RGBA_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -415,7 +415,7 @@ static void write_span_8R8G8B_pixmap( RGBA_SPAN_ARGS )
*/
static void write_span_8R8G8B24_pixmap( RGBA_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -509,7 +509,7 @@ static void write_span_8R8G8B24_pixmap( RGBA_SPAN_ARGS )
*/
static void write_span_rgb_8R8G8B_pixmap( RGB_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -540,7 +540,7 @@ static void write_span_rgb_8R8G8B_pixmap( RGB_SPAN_ARGS )
*/
static void write_span_rgb_8R8G8B24_pixmap( RGB_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -639,7 +639,7 @@ static void write_span_rgb_8R8G8B24_pixmap( RGB_SPAN_ARGS )
*/
static void write_span_5R6G5B_pixmap( RGBA_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -670,7 +670,7 @@ static void write_span_5R6G5B_pixmap( RGBA_SPAN_ARGS )
*/
static void write_span_DITHER_5R6G5B_pixmap( RGBA_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -703,7 +703,7 @@ static void write_span_DITHER_5R6G5B_pixmap( RGBA_SPAN_ARGS )
*/
static void write_span_rgb_5R6G5B_pixmap( RGB_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -734,7 +734,7 @@ static void write_span_rgb_5R6G5B_pixmap( RGB_SPAN_ARGS )
*/
static void write_span_rgb_DITHER_5R6G5B_pixmap( RGB_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -768,7 +768,7 @@ static void write_span_rgb_DITHER_5R6G5B_pixmap( RGB_SPAN_ARGS )
*/
static void write_span_DITHER_pixmap( RGBA_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -799,7 +799,7 @@ static void write_span_DITHER_pixmap( RGBA_SPAN_ARGS )
*/
static void write_span_rgb_DITHER_pixmap( RGB_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -830,7 +830,7 @@ static void write_span_rgb_DITHER_pixmap( RGB_SPAN_ARGS )
*/
static void write_span_1BIT_pixmap( RGBA_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -863,7 +863,7 @@ static void write_span_1BIT_pixmap( RGBA_SPAN_ARGS )
*/
static void write_span_rgb_1BIT_pixmap( RGB_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -896,7 +896,7 @@ static void write_span_rgb_1BIT_pixmap( RGB_SPAN_ARGS )
*/
static void write_span_HPCR_pixmap( RGBA_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -927,7 +927,7 @@ static void write_span_HPCR_pixmap( RGBA_SPAN_ARGS )
*/
static void write_span_rgb_HPCR_pixmap( RGB_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -958,7 +958,7 @@ static void write_span_rgb_HPCR_pixmap( RGB_SPAN_ARGS )
*/
static void write_span_LOOKUP_pixmap( RGBA_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -988,7 +988,7 @@ static void write_span_LOOKUP_pixmap( RGBA_SPAN_ARGS )
*/
static void write_span_rgb_LOOKUP_pixmap( RGB_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -1019,7 +1019,7 @@ static void write_span_rgb_LOOKUP_pixmap( RGB_SPAN_ARGS )
*/
static void write_span_GRAYSCALE_pixmap( RGBA_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -1048,7 +1048,7 @@ static void write_span_GRAYSCALE_pixmap( RGBA_SPAN_ARGS )
*/
static void write_span_rgb_GRAYSCALE_pixmap( RGB_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -1077,7 +1077,7 @@ static void write_span_rgb_GRAYSCALE_pixmap( RGB_SPAN_ARGS )
*/
static void write_span_TRUECOLOR_ximage( RGBA_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
y = FLIP(xmesa->xm_buffer, y);
@@ -1106,7 +1106,7 @@ static void write_span_TRUECOLOR_ximage( RGBA_SPAN_ARGS )
*/
static void write_span_rgb_TRUECOLOR_ximage( RGB_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
y = FLIP(xmesa->xm_buffer, y);
@@ -1135,7 +1135,7 @@ static void write_span_rgb_TRUECOLOR_ximage( RGB_SPAN_ARGS )
*/
static void write_span_TRUEDITHER_ximage( RGBA_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
y = FLIP(xmesa->xm_buffer, y);
@@ -1164,7 +1164,7 @@ static void write_span_TRUEDITHER_ximage( RGBA_SPAN_ARGS )
*/
static void write_span_rgb_TRUEDITHER_ximage( RGB_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
y = FLIP(xmesa->xm_buffer, y);
@@ -1193,7 +1193,7 @@ static void write_span_rgb_TRUEDITHER_ximage( RGB_SPAN_ARGS )
*/
static void write_span_8A8B8G8R_ximage( RGBA_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
register GLuint i;
register GLuint *ptr = PIXELADDR4( xmesa->xm_buffer, x, y );
if (mask) {
@@ -1217,7 +1217,7 @@ static void write_span_8A8B8G8R_ximage( RGBA_SPAN_ARGS )
*/
static void write_span_rgb_8A8B8G8R_ximage( RGB_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
register GLuint i;
register GLuint *ptr = PIXELADDR4( xmesa->xm_buffer, x, y );
if (mask) {
@@ -1241,7 +1241,7 @@ static void write_span_rgb_8A8B8G8R_ximage( RGB_SPAN_ARGS )
*/
static void write_span_8R8G8B_ximage( RGBA_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
register GLuint i;
register GLuint *ptr = PIXELADDR4( xmesa->xm_buffer, x, y );
if (mask) {
@@ -1264,7 +1264,7 @@ static void write_span_8R8G8B_ximage( RGBA_SPAN_ARGS )
*/
static void write_span_8R8G8B24_ximage( RGBA_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
register GLuint i;
register GLubyte *ptr = (GLubyte *) PIXELADDR3( xmesa->xm_buffer, x, y );
if (mask) {
@@ -1414,7 +1414,7 @@ static void write_span_8R8G8B24_ximage( RGBA_SPAN_ARGS )
*/
static void write_span_rgb_8R8G8B_ximage( RGB_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
register GLuint i;
register GLuint *ptr = PIXELADDR4( xmesa->xm_buffer, x, y );
if (mask) {
@@ -1438,7 +1438,7 @@ static void write_span_rgb_8R8G8B_ximage( RGB_SPAN_ARGS )
*/
static void write_span_rgb_8R8G8B24_ximage( RGB_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
register GLuint i;
register GLubyte *ptr = (GLubyte *) PIXELADDR3( xmesa->xm_buffer, x, y );
if (mask) {
@@ -1469,7 +1469,7 @@ static void write_span_rgb_8R8G8B24_ximage( RGB_SPAN_ARGS )
*/
static void write_span_5R6G5B_ximage( RGBA_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
register GLuint i;
register GLushort *ptr = PIXELADDR2( xmesa->xm_buffer, x, y );
if (mask) {
@@ -1508,7 +1508,7 @@ static void write_span_5R6G5B_ximage( RGBA_SPAN_ARGS )
*/
static void write_span_DITHER_5R6G5B_ximage( RGBA_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
register GLuint i;
register GLushort *ptr = PIXELADDR2( xmesa->xm_buffer, x, y );
const GLint y2 = FLIP(xmesa->xm_buffer, y);
@@ -1548,7 +1548,7 @@ static void write_span_DITHER_5R6G5B_ximage( RGBA_SPAN_ARGS )
*/
static void write_span_rgb_5R6G5B_ximage( RGB_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
register GLuint i;
register GLushort *ptr = PIXELADDR2( xmesa->xm_buffer, x, y );
if (mask) {
@@ -1587,7 +1587,7 @@ static void write_span_rgb_5R6G5B_ximage( RGB_SPAN_ARGS )
*/
static void write_span_rgb_DITHER_5R6G5B_ximage( RGB_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
register GLuint i;
register GLushort *ptr = PIXELADDR2( xmesa->xm_buffer, x, y );
if (mask) {
@@ -1626,7 +1626,7 @@ static void write_span_rgb_DITHER_5R6G5B_ximage( RGB_SPAN_ARGS )
*/
static void write_span_DITHER_ximage( RGBA_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
int yy = FLIP(xmesa->xm_buffer, y);
@@ -1652,7 +1652,7 @@ static void write_span_DITHER_ximage( RGBA_SPAN_ARGS )
*/
static void write_span_rgb_DITHER_ximage( RGB_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
int yy = FLIP(xmesa->xm_buffer, y);
@@ -1679,7 +1679,7 @@ static void write_span_rgb_DITHER_ximage( RGB_SPAN_ARGS )
*/
static void write_span_DITHER8_ximage( RGBA_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
register GLuint i;
register GLubyte *ptr = PIXELADDR1( xmesa->xm_buffer, x, y );
XDITHER_SETUP(y);
@@ -1700,7 +1700,7 @@ static void write_span_DITHER8_ximage( RGBA_SPAN_ARGS )
static void write_span_rgb_DITHER8_ximage( RGB_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
register GLuint i;
register GLubyte *ptr = PIXELADDR1( xmesa->xm_buffer, x, y );
XDITHER_SETUP(y);
@@ -1727,7 +1727,7 @@ static void write_span_rgb_DITHER8_ximage( RGB_SPAN_ARGS )
*/
static void write_span_1BIT_ximage( RGBA_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
SETUP_1BIT;
@@ -1752,7 +1752,7 @@ static void write_span_1BIT_ximage( RGBA_SPAN_ARGS )
*/
static void write_span_rgb_1BIT_ximage( RGB_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
SETUP_1BIT;
@@ -1777,7 +1777,7 @@ static void write_span_rgb_1BIT_ximage( RGB_SPAN_ARGS )
*/
static void write_span_HPCR_ximage( RGBA_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
register GLuint i;
register GLubyte *ptr = PIXELADDR1( xmesa->xm_buffer, x, y );
if (mask) {
@@ -1801,7 +1801,7 @@ static void write_span_HPCR_ximage( RGBA_SPAN_ARGS )
*/
static void write_span_rgb_HPCR_ximage( RGB_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
register GLuint i;
register GLubyte *ptr = PIXELADDR1( xmesa->xm_buffer, x, y );
if (mask) {
@@ -1825,7 +1825,7 @@ static void write_span_rgb_HPCR_ximage( RGB_SPAN_ARGS )
*/
static void write_span_LOOKUP_ximage( RGBA_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
LOOKUP_SETUP;
@@ -1851,7 +1851,7 @@ static void write_span_LOOKUP_ximage( RGBA_SPAN_ARGS )
*/
static void write_span_rgb_LOOKUP_ximage( RGB_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
LOOKUP_SETUP;
@@ -1877,7 +1877,7 @@ static void write_span_rgb_LOOKUP_ximage( RGB_SPAN_ARGS )
*/
static void write_span_LOOKUP8_ximage( RGBA_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
register GLuint i;
register GLubyte *ptr = PIXELADDR1( xmesa->xm_buffer, x, y );
LOOKUP_SETUP;
@@ -1902,7 +1902,7 @@ static void write_rgb_LOOKUP8_ximage( const GLcontext *ctx,
CONST GLubyte rgb[][3],
const GLubyte mask[] )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
register GLuint i;
register GLubyte *ptr = PIXELADDR1( xmesa->xm_buffer, x, y );
LOOKUP_SETUP;
@@ -1929,7 +1929,7 @@ static void write_rgb_LOOKUP8_ximage( const GLcontext *ctx,
*/
static void write_span_GRAYSCALE_ximage( RGBA_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
y = FLIP(xmesa->xm_buffer, y);
@@ -1954,7 +1954,7 @@ static void write_span_GRAYSCALE_ximage( RGBA_SPAN_ARGS )
*/
static void write_span_rgb_GRAYSCALE_ximage( RGB_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
y = FLIP(xmesa->xm_buffer, y);
@@ -1979,7 +1979,7 @@ static void write_span_rgb_GRAYSCALE_ximage( RGB_SPAN_ARGS )
*/
static void write_span_GRAYSCALE8_ximage( RGBA_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
register GLuint i;
register GLubyte *ptr = PIXELADDR1( xmesa->xm_buffer, x, y );
if (mask) {
@@ -2003,7 +2003,7 @@ static void write_span_GRAYSCALE8_ximage( RGBA_SPAN_ARGS )
*/
static void write_span_rgb_GRAYSCALE8_ximage( RGB_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
register GLuint i;
register GLubyte *ptr = PIXELADDR1( xmesa->xm_buffer, x, y );
if (mask) {
@@ -2039,7 +2039,7 @@ static void write_span_rgb_GRAYSCALE8_ximage( RGB_SPAN_ARGS )
*/
static void write_pixels_TRUECOLOR_pixmap( RGBA_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -2060,7 +2060,7 @@ static void write_pixels_TRUECOLOR_pixmap( RGBA_PIXEL_ARGS )
*/
static void write_pixels_TRUEDITHER_pixmap( RGBA_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -2081,7 +2081,7 @@ static void write_pixels_TRUEDITHER_pixmap( RGBA_PIXEL_ARGS )
*/
static void write_pixels_8A8B8G8R_pixmap( RGBA_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -2101,7 +2101,7 @@ static void write_pixels_8A8B8G8R_pixmap( RGBA_PIXEL_ARGS )
*/
static void write_pixels_8R8G8B_pixmap( RGBA_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -2120,7 +2120,7 @@ static void write_pixels_8R8G8B_pixmap( RGBA_PIXEL_ARGS )
*/
static void write_pixels_8R8G8B24_pixmap( RGBA_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -2139,7 +2139,7 @@ static void write_pixels_8R8G8B24_pixmap( RGBA_PIXEL_ARGS )
*/
static void write_pixels_5R6G5B_pixmap( RGBA_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -2158,7 +2158,7 @@ static void write_pixels_5R6G5B_pixmap( RGBA_PIXEL_ARGS )
*/
static void write_pixels_DITHER_5R6G5B_pixmap( RGBA_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -2179,7 +2179,7 @@ static void write_pixels_DITHER_5R6G5B_pixmap( RGBA_PIXEL_ARGS )
*/
static void write_pixels_DITHER_pixmap( RGBA_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -2200,7 +2200,7 @@ static void write_pixels_DITHER_pixmap( RGBA_PIXEL_ARGS )
*/
static void write_pixels_1BIT_pixmap( RGBA_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -2221,7 +2221,7 @@ static void write_pixels_1BIT_pixmap( RGBA_PIXEL_ARGS )
*/
static void write_pixels_HPCR_pixmap( RGBA_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -2241,7 +2241,7 @@ static void write_pixels_HPCR_pixmap( RGBA_PIXEL_ARGS )
*/
static void write_pixels_LOOKUP_pixmap( RGBA_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -2261,7 +2261,7 @@ static void write_pixels_LOOKUP_pixmap( RGBA_PIXEL_ARGS )
*/
static void write_pixels_GRAYSCALE_pixmap( RGBA_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -2280,7 +2280,7 @@ static void write_pixels_GRAYSCALE_pixmap( RGBA_PIXEL_ARGS )
*/
static void write_pixels_TRUECOLOR_ximage( RGBA_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
for (i=0;i<n;i++) {
@@ -2298,7 +2298,7 @@ static void write_pixels_TRUECOLOR_ximage( RGBA_PIXEL_ARGS )
*/
static void write_pixels_TRUEDITHER_ximage( RGBA_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
for (i=0;i<n;i++) {
@@ -2316,7 +2316,7 @@ static void write_pixels_TRUEDITHER_ximage( RGBA_PIXEL_ARGS )
*/
static void write_pixels_8A8B8G8R_ximage( RGBA_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
register GLuint i;
for (i=0;i<n;i++) {
if (mask[i]) {
@@ -2332,7 +2332,7 @@ static void write_pixels_8A8B8G8R_ximage( RGBA_PIXEL_ARGS )
*/
static void write_pixels_8R8G8B_ximage( RGBA_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
register GLuint i;
for (i=0;i<n;i++) {
if (mask[i]) {
@@ -2348,7 +2348,7 @@ static void write_pixels_8R8G8B_ximage( RGBA_PIXEL_ARGS )
*/
static void write_pixels_8R8G8B24_ximage( RGBA_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
register GLuint i;
for (i=0;i<n;i++) {
if (mask[i]) {
@@ -2366,7 +2366,7 @@ static void write_pixels_8R8G8B24_ximage( RGBA_PIXEL_ARGS )
*/
static void write_pixels_5R6G5B_ximage( RGBA_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
register GLuint i;
for (i=0;i<n;i++) {
if (mask[i]) {
@@ -2382,7 +2382,7 @@ static void write_pixels_5R6G5B_ximage( RGBA_PIXEL_ARGS )
*/
static void write_pixels_DITHER_5R6G5B_ximage( RGBA_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
register GLuint i;
for (i=0;i<n;i++) {
if (mask[i]) {
@@ -2398,7 +2398,7 @@ static void write_pixels_DITHER_5R6G5B_ximage( RGBA_PIXEL_ARGS )
*/
static void write_pixels_DITHER_ximage( RGBA_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
DITHER_SETUP;
@@ -2416,7 +2416,7 @@ static void write_pixels_DITHER_ximage( RGBA_PIXEL_ARGS )
*/
static void write_pixels_DITHER8_ximage( RGBA_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
register GLuint i;
DITHER_SETUP;
for (i=0;i<n;i++) {
@@ -2433,7 +2433,7 @@ static void write_pixels_DITHER8_ximage( RGBA_PIXEL_ARGS )
*/
static void write_pixels_1BIT_ximage( RGBA_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
SETUP_1BIT;
@@ -2451,7 +2451,7 @@ static void write_pixels_1BIT_ximage( RGBA_PIXEL_ARGS )
*/
static void write_pixels_HPCR_ximage( RGBA_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
register GLuint i;
for (i=0;i<n;i++) {
if (mask[i]) {
@@ -2467,7 +2467,7 @@ static void write_pixels_HPCR_ximage( RGBA_PIXEL_ARGS )
*/
static void write_pixels_LOOKUP_ximage( RGBA_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
LOOKUP_SETUP;
@@ -2484,7 +2484,7 @@ static void write_pixels_LOOKUP_ximage( RGBA_PIXEL_ARGS )
*/
static void write_pixels_LOOKUP8_ximage( RGBA_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
register GLuint i;
LOOKUP_SETUP;
for (i=0;i<n;i++) {
@@ -2501,7 +2501,7 @@ static void write_pixels_LOOKUP8_ximage( RGBA_PIXEL_ARGS )
*/
static void write_pixels_GRAYSCALE_ximage( RGBA_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
for (i=0;i<n;i++) {
@@ -2518,7 +2518,7 @@ static void write_pixels_GRAYSCALE_ximage( RGBA_PIXEL_ARGS )
*/
static void write_pixels_GRAYSCALE8_ximage( RGBA_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
register GLuint i;
for (i=0;i<n;i++) {
if (mask[i]) {
@@ -2545,7 +2545,7 @@ static void write_pixels_GRAYSCALE8_ximage( RGBA_PIXEL_ARGS )
*/
static void write_span_mono_pixmap( MONO_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -2584,7 +2584,7 @@ static void write_span_mono_index_pixmap( const GLcontext *ctx, GLuint n,
GLint x, GLint y, GLuint colorIndex,
const GLubyte mask[] )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -2619,7 +2619,7 @@ static void write_span_mono_index_pixmap( const GLcontext *ctx, GLuint n,
*/
static void write_span_mono_TRUEDITHER_pixmap( MONO_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -2642,7 +2642,7 @@ static void write_span_mono_TRUEDITHER_pixmap( MONO_SPAN_ARGS )
*/
static void write_span_mono_DITHER_pixmap( MONO_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -2664,7 +2664,7 @@ static void write_span_mono_DITHER_pixmap( MONO_SPAN_ARGS )
*/
static void write_span_mono_1BIT_pixmap( MONO_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -2686,7 +2686,7 @@ static void write_span_mono_1BIT_pixmap( MONO_SPAN_ARGS )
*/
static void write_span_mono_ximage( MONO_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
const unsigned long pixel = xmesa_color_to_pixel(xmesa, color[RCOMP],
@@ -2705,7 +2705,7 @@ static void write_span_mono_index_ximage( const GLcontext *ctx, GLuint n,
GLuint colorIndex,
const GLubyte mask[] )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
y = FLIP(xmesa->xm_buffer, y);
@@ -2722,7 +2722,7 @@ static void write_span_mono_index_ximage( const GLcontext *ctx, GLuint n,
*/
static void write_span_mono_TRUEDITHER_ximage( MONO_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaImage *img = xmesa->xm_buffer->backimage;
const GLint r = color[RCOMP], g = color[GCOMP], b = color[BCOMP];
GLuint i;
@@ -2742,7 +2742,7 @@ static void write_span_mono_TRUEDITHER_ximage( MONO_SPAN_ARGS )
*/
static void write_span_mono_8A8B8G8R_ximage( MONO_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
GLuint i, *ptr;
const unsigned long pixel = xmesa_color_to_pixel(xmesa, color[RCOMP],
color[GCOMP], color[BCOMP], color[ACOMP], xmesa->pixelformat);
@@ -2760,7 +2760,7 @@ static void write_span_mono_8A8B8G8R_ximage( MONO_SPAN_ARGS )
*/
static void write_span_mono_8R8G8B_ximage( MONO_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
const GLuint pixel = PACK_8R8G8B(color[RCOMP], color[GCOMP], color[BCOMP]);
GLuint *ptr = PIXELADDR4( xmesa->xm_buffer, x, y );
GLuint i;
@@ -2777,7 +2777,7 @@ static void write_span_mono_8R8G8B_ximage( MONO_SPAN_ARGS )
*/
static void write_span_mono_8R8G8B24_ximage( MONO_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
const GLubyte r = color[RCOMP];
const GLubyte g = color[GCOMP];
const GLubyte b = color[BCOMP];
@@ -2798,7 +2798,7 @@ static void write_span_mono_8R8G8B24_ximage( MONO_SPAN_ARGS )
*/
static void write_span_mono_DITHER_ximage( MONO_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
const GLubyte r = color[RCOMP], g = color[GCOMP], b = color[BCOMP];
XMesaImage *img = xmesa->xm_buffer->backimage;
int yy = FLIP(xmesa->xm_buffer, y);
@@ -2817,7 +2817,7 @@ static void write_span_mono_DITHER_ximage( MONO_SPAN_ARGS )
*/
static void write_span_mono_DITHER8_ximage( MONO_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
const GLubyte r = color[RCOMP], g = color[GCOMP], b = color[BCOMP];
register GLubyte *ptr = PIXELADDR1( xmesa->xm_buffer,x,y);
register GLuint i;
@@ -2835,7 +2835,7 @@ static void write_span_mono_DITHER8_ximage( MONO_SPAN_ARGS )
*/
static void write_span_mono_LOOKUP8_ximage( MONO_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
register GLuint i;
register GLubyte *ptr = PIXELADDR1( xmesa->xm_buffer,x,y);
GLubyte pixel;
@@ -2854,7 +2854,7 @@ static void write_span_mono_LOOKUP8_ximage( MONO_SPAN_ARGS )
*/
static void write_span_mono_1BIT_ximage( MONO_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
const GLubyte r = color[RCOMP], g = color[GCOMP], b = color[BCOMP];
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
@@ -2873,7 +2873,7 @@ static void write_span_mono_1BIT_ximage( MONO_SPAN_ARGS )
*/
static void write_span_mono_HPCR_ximage( MONO_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
const GLubyte r = color[RCOMP], g = color[GCOMP], b = color[BCOMP];
register GLubyte *ptr = PIXELADDR1( xmesa->xm_buffer,x,y);
register GLuint i;
@@ -2890,7 +2890,7 @@ static void write_span_mono_HPCR_ximage( MONO_SPAN_ARGS )
*/
static void write_span_mono_GRAYSCALE8_ximage( MONO_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
const GLubyte p = GRAY_RGB(color[RCOMP], color[GCOMP], color[BCOMP]);
GLubyte *ptr = (GLubyte *) PIXELADDR1( xmesa->xm_buffer,x,y);
GLuint i;
@@ -2908,7 +2908,7 @@ static void write_span_mono_GRAYSCALE8_ximage( MONO_SPAN_ARGS )
*/
static void write_span_mono_DITHER_5R6G5B_ximage( MONO_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
register GLushort *ptr = PIXELADDR2( xmesa->xm_buffer, x, y );
const GLint r = color[RCOMP], g = color[GCOMP], b = color[BCOMP];
GLuint i;
@@ -2935,7 +2935,7 @@ static void write_span_mono_DITHER_5R6G5B_ximage( MONO_SPAN_ARGS )
*/
static void write_pixels_mono_pixmap( MONO_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -2958,7 +2958,7 @@ static void write_pixels_mono_index_pixmap(const GLcontext *ctx,
GLuint colorIndex,
const GLubyte mask[] )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -2978,7 +2978,7 @@ static void write_pixels_mono_index_pixmap(const GLcontext *ctx,
*/
static void write_pixels_mono_TRUEDITHER_pixmap( MONO_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -3001,7 +3001,7 @@ static void write_pixels_mono_TRUEDITHER_pixmap( MONO_PIXEL_ARGS )
*/
static void write_pixels_mono_DITHER_pixmap( MONO_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -3022,7 +3022,7 @@ static void write_pixels_mono_DITHER_pixmap( MONO_PIXEL_ARGS )
*/
static void write_pixels_mono_1BIT_pixmap( MONO_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -3043,7 +3043,7 @@ static void write_pixels_mono_1BIT_pixmap( MONO_PIXEL_ARGS )
*/
static void write_pixels_mono_ximage( MONO_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
const unsigned long pixel = xmesa_color_to_pixel(xmesa, color[RCOMP],
@@ -3061,7 +3061,7 @@ static void write_pixels_mono_index_ximage( const GLcontext *ctx, GLuint n,
GLuint colorIndex,
const GLubyte mask[] )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
for (i=0;i<n;i++) {
@@ -3077,7 +3077,7 @@ static void write_pixels_mono_index_ximage( const GLcontext *ctx, GLuint n,
*/
static void write_pixels_mono_TRUEDITHER_ximage( MONO_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
const int r = color[RCOMP], g = color[GCOMP], b = color[BCOMP];
@@ -3097,7 +3097,7 @@ static void write_pixels_mono_TRUEDITHER_ximage( MONO_PIXEL_ARGS )
*/
static void write_pixels_mono_8A8B8G8R_ximage( MONO_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
const GLuint p = PACK_8A8B8G8R(color[RCOMP], color[GCOMP],
color[BCOMP], color[ACOMP]);
register GLuint i;
@@ -3115,7 +3115,7 @@ static void write_pixels_mono_8A8B8G8R_ximage( MONO_PIXEL_ARGS )
*/
static void write_pixels_mono_8R8G8B_ximage( MONO_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
register GLuint i;
const GLuint p = PACK_8R8G8B(color[RCOMP], color[GCOMP], color[BCOMP]);
for (i=0;i<n;i++) {
@@ -3132,7 +3132,7 @@ static void write_pixels_mono_8R8G8B_ximage( MONO_PIXEL_ARGS )
*/
static void write_pixels_mono_8R8G8B24_ximage( MONO_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
const GLubyte r = color[RCOMP], g = color[GCOMP], b = color[BCOMP];
register GLuint i;
for (i=0;i<n;i++) {
@@ -3151,7 +3151,7 @@ static void write_pixels_mono_8R8G8B24_ximage( MONO_PIXEL_ARGS )
*/
static void write_pixels_mono_DITHER_ximage( MONO_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
const GLubyte r = color[RCOMP], g = color[GCOMP], b = color[BCOMP];
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
@@ -3169,7 +3169,7 @@ static void write_pixels_mono_DITHER_ximage( MONO_PIXEL_ARGS )
*/
static void write_pixels_mono_DITHER8_ximage( MONO_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
const GLubyte r = color[RCOMP], g = color[GCOMP], b = color[BCOMP];
register GLuint i;
DITHER_SETUP;
@@ -3187,7 +3187,7 @@ static void write_pixels_mono_DITHER8_ximage( MONO_PIXEL_ARGS )
*/
static void write_pixels_mono_LOOKUP8_ximage( MONO_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
register GLuint i;
GLubyte pixel;
LOOKUP_SETUP;
@@ -3207,7 +3207,7 @@ static void write_pixels_mono_LOOKUP8_ximage( MONO_PIXEL_ARGS )
*/
static void write_pixels_mono_1BIT_ximage( MONO_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
const GLubyte r = color[RCOMP], g = color[GCOMP], b = color[BCOMP];
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
@@ -3226,7 +3226,7 @@ static void write_pixels_mono_1BIT_ximage( MONO_PIXEL_ARGS )
*/
static void write_pixels_mono_HPCR_ximage( MONO_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
const GLubyte r = color[RCOMP], g = color[GCOMP], b = color[BCOMP];
register GLuint i;
for (i=0;i<n;i++) {
@@ -3243,7 +3243,7 @@ static void write_pixels_mono_HPCR_ximage( MONO_PIXEL_ARGS )
*/
static void write_pixels_mono_GRAYSCALE8_ximage( MONO_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
register GLuint i;
register GLubyte p = GRAY_RGB(color[RCOMP], color[GCOMP], color[BCOMP]);
for (i=0;i<n;i++) {
@@ -3260,7 +3260,7 @@ static void write_pixels_mono_GRAYSCALE8_ximage( MONO_PIXEL_ARGS )
*/
static void write_pixels_mono_DITHER_5R6G5B_ximage( MONO_PIXEL_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
const int r = color[RCOMP], g = color[GCOMP], b = color[BCOMP];
register GLuint i;
for (i=0;i<n;i++) {
@@ -3291,7 +3291,7 @@ static void write_pixels_mono_DITHER_5R6G5B_ximage( MONO_PIXEL_ARGS )
*/
static void write_span_index_pixmap( INDEX_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -3319,7 +3319,7 @@ static void write_span_index_pixmap( INDEX_SPAN_ARGS )
*/
static void write_span_index8_pixmap( INDEX8_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -3347,7 +3347,7 @@ static void write_span_index8_pixmap( INDEX8_SPAN_ARGS )
*/
static void write_span_index_ximage( INDEX_SPAN_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
y = FLIP(xmesa->xm_buffer, y);
@@ -3373,7 +3373,7 @@ static void write_span_index8_ximage( const GLcontext *ctx, GLuint n,
GLint x, GLint y, const GLubyte index[],
const GLubyte mask[] )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
if (mask) {
GLuint i;
for (i=0;i<n;i++) {
@@ -3397,7 +3397,7 @@ static void write_span_index8_ximage8( const GLcontext *ctx, GLuint n,
GLint x, GLint y, const GLubyte index[],
const GLubyte mask[] )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
GLubyte *dst = PIXELADDR1( xmesa->xm_buffer,x,y);
if (mask) {
GLuint i;
@@ -3428,7 +3428,7 @@ static void write_span_index8_ximage8( const GLcontext *ctx, GLuint n,
*/
static void write_pixels_index_pixmap( INDEX_PIXELS_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc;
@@ -3447,7 +3447,7 @@ static void write_pixels_index_pixmap( INDEX_PIXELS_ARGS )
*/
static void write_pixels_index_ximage( INDEX_PIXELS_ARGS )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
for (i=0;i<n;i++) {
@@ -3472,7 +3472,7 @@ static void write_pixels_index_ximage( INDEX_PIXELS_ARGS )
static void read_index_span( const GLcontext *ctx,
GLuint n, GLint x, GLint y, GLuint index[] )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaBuffer source = xmesa->xm_buffer;
GLuint i;
@@ -3523,7 +3523,7 @@ static void read_color_span( const GLcontext *ctx,
GLuint n, GLint x, GLint y,
GLubyte rgba[][4] )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaBuffer source = xmesa->xm_buffer;
if (source->buffer) {
@@ -3891,7 +3891,7 @@ static void read_index_pixels( const GLcontext *ctx,
GLuint n, const GLint x[], const GLint y[],
GLuint indx[], const GLubyte mask[] )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
register GLuint i;
XMesaBuffer source = xmesa->xm_buffer;
@@ -3920,7 +3920,7 @@ static void read_color_pixels( const GLcontext *ctx,
GLuint n, const GLint x[], const GLint y[],
GLubyte rgba[][4], const GLubyte mask[] )
{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaDisplay *dpy = xmesa->xm_visual->display;
register GLuint i;
XMesaBuffer source = xmesa->xm_buffer;
@@ -4167,7 +4167,7 @@ static void
clear_color_HPCR_ximage( GLcontext *ctx, const GLfloat color[4] )
{
int i;
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[0], color[0]);
CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[1], color[1]);
@@ -4201,7 +4201,7 @@ static void
clear_color_HPCR_pixmap( GLcontext *ctx, const GLfloat color[4] )
{
int i;
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[0], color[0]);
CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[1], color[1]);
@@ -4240,7 +4240,7 @@ clear_color_HPCR_pixmap( GLcontext *ctx, const GLfloat color[4] )
void xmesa_update_span_funcs( GLcontext *ctx )
{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ XMesaContext xmesa = XMESA_CONTEXT(ctx);
int depth=GET_VISUAL_DEPTH(xmesa->xm_visual);
struct swrast_device_driver *dd = _swrast_GetDeviceDriverReference( ctx );
diff --git a/src/mesa/drivers/x11/xm_tri.c b/src/mesa/drivers/x11/xm_tri.c
index 602eba41e6..e5d76e26a6 100644
--- a/src/mesa/drivers/x11/xm_tri.c
+++ b/src/mesa/drivers/x11/xm_tri.c
@@ -1,4 +1,4 @@
-/* $Id: xm_tri.c,v 1.32 2003/03/01 01:50:24 brianp Exp $ */
+/* $Id: xm_tri.c,v 1.33 2003/04/01 17:28:12 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -60,7 +60,7 @@
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INTERP_RGB 1
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
XMesaImage *img = xmesa->xm_buffer->backimage;
#define RENDER_SPAN( span ) \
@@ -97,7 +97,7 @@
#define PIXEL_TYPE GLuint
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
#define RENDER_SPAN( span ) \
GLuint i; \
@@ -129,7 +129,7 @@
#define PIXEL_TYPE GLuint
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
#define RENDER_SPAN( span ) \
GLuint i; \
@@ -161,7 +161,7 @@
#define PIXEL_TYPE bgr_t
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ XMesaContext xmesa = XMESA_CONTEXT(ctx);
#define RENDER_SPAN( span ) \
GLuint i; \
for (i = 0; i < span.end; i++) { \
@@ -190,7 +190,7 @@
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INTERP_RGB 1
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
XMesaImage *img = xmesa->xm_buffer->backimage;
#define RENDER_SPAN( span ) \
GLuint i; \
@@ -224,7 +224,7 @@
#define PIXEL_TYPE GLushort
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ XMesaContext xmesa = XMESA_CONTEXT(ctx);
#define RENDER_SPAN( span ) \
GLuint i; \
for (i = 0; i < span.end; i++) { \
@@ -254,7 +254,7 @@
#define PIXEL_TYPE GLushort
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ XMesaContext xmesa = XMESA_CONTEXT(ctx);
#define RENDER_SPAN( span ) \
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
@@ -285,7 +285,7 @@
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ XMesaContext xmesa = XMESA_CONTEXT(ctx);
#define RENDER_SPAN( span ) \
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
@@ -314,7 +314,7 @@
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INTERP_RGB 1
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
XMesaImage *img = xmesa->xm_buffer->backimage;
#define RENDER_SPAN( span ) \
GLuint i; \
@@ -348,7 +348,7 @@
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ XMesaContext xmesa = XMESA_CONTEXT(ctx);
#define RENDER_SPAN( span ) \
GLuint i; \
LOOKUP_SETUP; \
@@ -379,7 +379,7 @@
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ XMesaContext xmesa = XMESA_CONTEXT(ctx);
#define RENDER_SPAN( span ) \
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
@@ -406,7 +406,7 @@
#define INTERP_Z 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
XMesaImage *img = xmesa->xm_buffer->backimage; \
unsigned long pixel; \
PACK_TRUECOLOR(pixel, v2->color[0], v2->color[1], v2->color[2]);
@@ -435,7 +435,7 @@
#define PIXEL_TYPE GLuint
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
unsigned long p = PACK_8B8G8R( v2->color[0], \
v2->color[1], v2->color[2] );
#define RENDER_SPAN( span ) \
@@ -462,7 +462,7 @@
#define PIXEL_TYPE GLuint
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
unsigned long p = PACK_8R8G8B( v2->color[0], \
v2->color[1], v2->color[2] );
#define RENDER_SPAN( span ) \
@@ -489,7 +489,7 @@
#define PIXEL_TYPE bgr_t
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
const GLubyte *color = v2->color;
#define RENDER_SPAN( span ) \
GLuint i; \
@@ -515,7 +515,7 @@
#define INTERP_Z 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
XMesaImage *img = xmesa->xm_buffer->backimage;
#define RENDER_SPAN( span ) \
GLuint i; \
@@ -545,7 +545,7 @@
#define PIXEL_TYPE GLushort
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
unsigned long p = PACK_5R6G5B( v2->color[0], \
v2->color[1], v2->color[2] );
#define RENDER_SPAN( span ) \
@@ -572,7 +572,7 @@
#define PIXEL_TYPE GLushort
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
const GLubyte *color = v2->color;
#define RENDER_SPAN( span ) \
GLuint i; \
@@ -600,7 +600,7 @@
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
FLAT_DITHER_SETUP( v2->color[0], v2->color[1], v2->color[2] );
#define RENDER_SPAN( span ) \
GLuint i; \
@@ -625,7 +625,7 @@
#define INTERP_Z 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
XMesaImage *img = xmesa->xm_buffer->backimage; \
FLAT_DITHER_SETUP( v2->color[0], v2->color[1], v2->color[2] );
#define RENDER_SPAN( span ) \
@@ -655,7 +655,7 @@
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
GLubyte r = v2->color[0]; \
GLubyte g = v2->color[1]; \
GLubyte b = v2->color[2];
@@ -684,7 +684,7 @@
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
LOOKUP_SETUP; \
GLubyte r = v2->color[0]; \
GLubyte g = v2->color[1]; \
@@ -710,7 +710,7 @@
#define NAME smooth_TRUECOLOR_triangle
#define INTERP_RGB 1
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
XMesaImage *img = xmesa->xm_buffer->backimage;
#define RENDER_SPAN( span ) \
GLuint i; \
@@ -737,7 +737,7 @@
#define PIXEL_TYPE GLuint
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ XMesaContext xmesa = XMESA_CONTEXT(ctx);
#define RENDER_SPAN( span ) \
GLuint i; \
for (i = 0; i < span.end; i++) { \
@@ -760,7 +760,7 @@
#define PIXEL_TYPE GLuint
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ XMesaContext xmesa = XMESA_CONTEXT(ctx);
#define RENDER_SPAN( span ) \
GLuint i; \
for (i = 0; i < span.end; i++) { \
@@ -783,7 +783,7 @@
#define PIXEL_TYPE bgr_t
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ XMesaContext xmesa = XMESA_CONTEXT(ctx);
#define RENDER_SPAN( span ) \
GLuint i; \
PIXEL_TYPE *pixel = pRow; \
@@ -805,7 +805,7 @@
#define NAME smooth_TRUEDITHER_triangle
#define INTERP_RGB 1
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
XMesaImage *img = xmesa->xm_buffer->backimage;
#define RENDER_SPAN( span ) \
GLuint i; \
@@ -832,7 +832,7 @@
#define PIXEL_TYPE GLushort
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ XMesaContext xmesa = XMESA_CONTEXT(ctx);
#define RENDER_SPAN( span ) \
GLuint i; \
for (i = 0; i < span.end; i++) { \
@@ -855,7 +855,7 @@
#define PIXEL_TYPE GLushort
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ XMesaContext xmesa = XMESA_CONTEXT(ctx);
#define RENDER_SPAN( span ) \
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
@@ -879,7 +879,7 @@
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ XMesaContext xmesa = XMESA_CONTEXT(ctx);
#define RENDER_SPAN( span ) \
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
@@ -901,7 +901,7 @@
#define NAME smooth_DITHER_triangle
#define INTERP_RGB 1
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
XMesaImage *img = xmesa->xm_buffer->backimage;
#define RENDER_SPAN( span ) \
GLuint i; \
@@ -928,7 +928,7 @@
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ XMesaContext xmesa = XMESA_CONTEXT(ctx);
#define RENDER_SPAN( span ) \
GLuint i; \
LOOKUP_SETUP; \
@@ -952,7 +952,7 @@
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ XMesaContext xmesa = XMESA_CONTEXT(ctx);
#define RENDER_SPAN( span ) \
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
@@ -972,7 +972,7 @@
*/
#define NAME flat_TRUECOLOR_triangle
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
XMesaImage *img = xmesa->xm_buffer->backimage; \
unsigned long pixel; \
PACK_TRUECOLOR(pixel, v2->color[0], v2->color[1], v2->color[2]);
@@ -994,7 +994,7 @@
#define PIXEL_TYPE GLuint
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
unsigned long p = PACK_8B8G8R( v2->color[0], \
v2->color[1], v2->color[2] );
#define RENDER_SPAN( span ) \
@@ -1014,7 +1014,7 @@
#define PIXEL_TYPE GLuint
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
unsigned long p = PACK_8R8G8B( v2->color[0], \
v2->color[1], v2->color[2] );
#define RENDER_SPAN( span ) \
@@ -1034,7 +1034,7 @@
#define PIXEL_TYPE bgr_t
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
const GLubyte *color = v2->color;
#define RENDER_SPAN( span ) \
GLuint i; \
@@ -1053,7 +1053,7 @@
*/
#define NAME flat_TRUEDITHER_triangle
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
XMesaImage *img = xmesa->xm_buffer->backimage;
#define RENDER_SPAN( span ) \
GLuint i; \
@@ -1076,7 +1076,7 @@
#define PIXEL_TYPE GLushort
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
unsigned long p = PACK_5R6G5B( v2->color[0], \
v2->color[1], v2->color[2] );
#define RENDER_SPAN( span ) \
@@ -1096,7 +1096,7 @@
#define PIXEL_TYPE GLushort
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
const GLubyte *color = v2->color;
#define RENDER_SPAN( span ) \
GLuint i; \
@@ -1117,7 +1117,7 @@
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
FLAT_DITHER_SETUP( v2->color[0], v2->color[1], v2->color[2] );
#define RENDER_SPAN( span ) \
GLuint i; \
@@ -1135,7 +1135,7 @@
*/
#define NAME flat_DITHER_triangle
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
XMesaImage *img = xmesa->xm_buffer->backimage; \
FLAT_DITHER_SETUP( v2->color[0], v2->color[1], v2->color[2] );
#define RENDER_SPAN( span ) \
@@ -1158,7 +1158,7 @@
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
GLubyte r = v2->color[0]; \
GLubyte g = v2->color[1]; \
GLubyte b = v2->color[2];
@@ -1180,7 +1180,7 @@
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
LOOKUP_SETUP; \
GLubyte r = v2->color[0]; \
GLubyte g = v2->color[1]; \
@@ -1307,7 +1307,7 @@ do { \
static swrast_tri_func get_triangle_func( GLcontext *ctx )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ XMesaContext xmesa = XMESA_CONTEXT(ctx);
int depth = GET_VISUAL_DEPTH(xmesa->xm_visual);
(void) kernel1;
diff --git a/src/mesa/drivers/x11/xmesaP.h b/src/mesa/drivers/x11/xmesaP.h
index 46886eb9c6..5024e527c2 100644
--- a/src/mesa/drivers/x11/xmesaP.h
+++ b/src/mesa/drivers/x11/xmesaP.h
@@ -1,4 +1,4 @@
-/* $Id: xmesaP.h,v 1.35 2003/02/25 19:26:30 brianp Exp $ */
+/* $Id: xmesaP.h,v 1.36 2003/04/01 17:28:12 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -137,7 +137,7 @@ struct xmesa_visual {
* "Derived" from __GLcontextRec. Basically corresponds to a GLXContext.
*/
struct xmesa_context {
- GLcontext *gl_ctx; /* the core library context */
+ GLcontext mesa; /* the core library context (containment) */
XMesaVisual xm_visual; /* Describes the buffers */
XMesaBuffer xm_draw_buffer; /* current draw framebuffer */
XMesaBuffer xm_read_buffer; /* current read framebuffer */
@@ -494,6 +494,15 @@ static int const kernel1[16] = {
+
+/*
+ * Return pointer to XMesaContext corresponding to a Mesa GLcontext.
+ * Since we're using structure containment, it's just a cast!.
+ */
+#define XMESA_CONTEXT(MESACTX) (XMesaContext) (MESACTX)
+
+
+
/*
* External functions:
*/