mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 22:38:05 +02:00
a little code movement so we don't make invalid casts from gl_renderbuffers to xmesa_renderbuffers
This commit is contained in:
parent
b8915340ea
commit
c7a5d528c7
3 changed files with 24 additions and 8 deletions
|
|
@ -214,10 +214,15 @@ color_mask(GLcontext *ctx,
|
|||
GLboolean rmask, GLboolean gmask, GLboolean bmask, GLboolean amask)
|
||||
{
|
||||
const XMesaContext xmesa = XMESA_CONTEXT(ctx);
|
||||
XMesaBuffer xmbuf = XMESA_BUFFER(ctx->DrawBuffer);
|
||||
XMesaBuffer xmbuf;
|
||||
const int xclass = xmesa->xm_visual->mesa_visual.visualType;
|
||||
(void) amask;
|
||||
|
||||
if (ctx->DrawBuffer->Name != 0)
|
||||
return;
|
||||
|
||||
xmbuf = XMESA_BUFFER(ctx->DrawBuffer);
|
||||
|
||||
if (xclass == GLX_TRUE_COLOR || xclass == GLX_DIRECT_COLOR) {
|
||||
unsigned long m;
|
||||
if (rmask && gmask && bmask) {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
* Mesa 3-D graphics library
|
||||
* Version: 6.5
|
||||
*
|
||||
* Copyright (C) 1999-2005 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"),
|
||||
|
|
@ -69,7 +69,7 @@ static void draw_points_ANY_pixmap( GLcontext *ctx, const SWvertex *vert )
|
|||
color[2], color[3],
|
||||
xmesa->pixelformat);
|
||||
XMesaSetForeground( dpy, gc, pixel );
|
||||
x = (GLint) vert->win[0];
|
||||
x = (GLint) vert->win[0];
|
||||
y = YFLIP( xrb, (GLint) vert->win[1] );
|
||||
XMesaDrawPoint( dpy, buffer, gc, x, y);
|
||||
}
|
||||
|
|
@ -577,7 +577,7 @@ get_line_func(GLcontext *ctx)
|
|||
XMesaContext xmesa = XMESA_CONTEXT(ctx);
|
||||
SWcontext *swrast = SWRAST_CONTEXT(ctx);
|
||||
int depth = GET_VISUAL_DEPTH(xmesa->xm_visual);
|
||||
GET_XRB(xrb);
|
||||
struct xmesa_renderbuffer *xrb;
|
||||
|
||||
if ((ctx->DrawBuffer->_ColorDrawBufferMask[0]
|
||||
& (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT)) == 0)
|
||||
|
|
@ -589,6 +589,9 @@ get_line_func(GLcontext *ctx)
|
|||
if (ctx->Line.StippleFlag) return (swrast_line_func) NULL;
|
||||
if (swrast->_RasterMask & MULTI_DRAW_BIT) return (swrast_line_func) NULL;
|
||||
|
||||
xrb = (struct xmesa_renderbuffer *)
|
||||
ctx->DrawBuffer->_ColorDrawBuffers[0][0]->Wrapped;
|
||||
|
||||
if (xrb->ximage
|
||||
&& swrast->_RasterMask==DEPTH_BIT
|
||||
&& ctx->Depth.Func==GL_LESS
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue