diff options
author | Brian Paul <[email protected]> | 2006-03-28 15:21:44 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2006-03-28 15:21:44 +0000 |
commit | c7a5d528c7e5f4812b423bf4c091d21c34af3cf1 (patch) | |
tree | 0cfaeee8d45666c644ad22f4a7b164e0de83d056 /src/mesa/drivers/x11/xm_tri.c | |
parent | b8915340eab706776244e04547f64444f0ff2f8b (diff) |
a little code movement so we don't make invalid casts from gl_renderbuffers to xmesa_renderbuffers
Diffstat (limited to 'src/mesa/drivers/x11/xm_tri.c')
-rw-r--r-- | src/mesa/drivers/x11/xm_tri.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/mesa/drivers/x11/xm_tri.c b/src/mesa/drivers/x11/xm_tri.c index 87989f46f89..61e8986a9b2 100644 --- a/src/mesa/drivers/x11/xm_tri.c +++ b/src/mesa/drivers/x11/xm_tri.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.3 + * Version: 6.5 * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -1425,12 +1425,17 @@ do { \ #endif -static swrast_tri_func get_triangle_func( GLcontext *ctx ) +/** + * Return pointer to line drawing function, or NULL if we should use a + * swrast fallback. + */ +static swrast_tri_func +get_triangle_func(GLcontext *ctx) { SWcontext *swrast = SWRAST_CONTEXT(ctx); XMesaContext xmesa = XMESA_CONTEXT(ctx); int depth = GET_VISUAL_DEPTH(xmesa->xm_visual); - GET_XRB(xrb); + struct xmesa_renderbuffer *xrb; #ifdef DEBUG triFuncName = NULL; @@ -1447,6 +1452,9 @@ static swrast_tri_func get_triangle_func( GLcontext *ctx ) ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK) return (swrast_tri_func) NULL; + xrb = (struct xmesa_renderbuffer *) + ctx->DrawBuffer->_ColorDrawBuffers[0][0]->Wrapped; + if (xrb->ximage) { if ( ctx->Light.ShadeModel==GL_SMOOTH && swrast->_RasterMask==DEPTH_BIT |