From c19d783e0715ac01ad4d3fd0705500d2bf6f7039 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 14 Nov 2000 17:40:13 +0000 Subject: Removed Driver.Color() and Driver.Index() functions. Pass color or color index directly to WriteMono*() span functions. Updated current s/w drivers accordingly. Clean-up of X gc handling in XMesa driver. --- src/mesa/swrast/s_span.c | 6 +++--- src/mesa/swrast/s_triangle.c | 24 +++++------------------- 2 files changed, 8 insertions(+), 22 deletions(-) (limited to 'src/mesa/swrast') diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index 019534710e..591d7d93a4 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -1,4 +1,4 @@ -/* $Id: s_span.c,v 1.3 2000/11/13 20:02:57 keithw Exp $ */ +/* $Id: s_span.c,v 1.4 2000/11/14 17:40:16 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -364,7 +364,7 @@ void gl_write_monoindex_span( GLcontext *ctx, } else { /* normal situation: draw to exactly one buffer */ - (*ctx->Driver.WriteMonoCISpan)( ctx, n, x, y, mask ); + (*ctx->Driver.WriteMonoCISpan)( ctx, n, x, y, index, mask ); } } } @@ -713,7 +713,7 @@ void gl_write_monocolor_span( GLcontext *ctx, (const GLchan (*)[4]) rgba, mask ); } else { - (*ctx->Driver.WriteMonoRGBASpan)( ctx, n, x, y, mask ); + (*ctx->Driver.WriteMonoRGBASpan)( ctx, n, x, y, color, mask ); if (swrast->_RasterMask & ALPHABUF_BIT) { _mesa_write_mono_alpha_span( ctx, n, x, y, (GLchan) color[ACOMP], write_all ? Null : mask ); diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c index 8ca640610e..b71da4f648 100644 --- a/src/mesa/swrast/s_triangle.c +++ b/src/mesa/swrast/s_triangle.c @@ -1,4 +1,4 @@ -/* $Id: s_triangle.c,v 1.3 2000/11/13 20:02:57 keithw Exp $ */ +/* $Id: s_triangle.c,v 1.4 2000/11/14 17:40:16 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -74,12 +74,7 @@ static void flat_ci_triangle( GLcontext *ctx, SWvertex *v2 ) { #define INTERP_Z 1 -#define SETUP_CODE \ - GLuint index = v0->index; \ - if (1) { \ - /* set the color index */ \ - (*ctx->Driver.Index)( ctx, index ); \ - } +#define SETUP_CODE #define INNER_LOOP( LEFT, RIGHT, Y ) \ { \ @@ -95,7 +90,7 @@ static void flat_ci_triangle( GLcontext *ctx, fffog += fdfogdx; \ } \ gl_write_monoindex_span( ctx, n, LEFT, Y, zspan, \ - fogspan, index, GL_POLYGON ); \ + fogspan, v0->index, GL_POLYGON ); \ } \ } @@ -152,15 +147,7 @@ static void flat_rgba_triangle( GLcontext *ctx, #define INTERP_Z 1 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE -#define SETUP_CODE \ - if (1) { \ - /* set the color */ \ - GLchan r = v0->color[0]; \ - GLchan g = v0->color[1]; \ - GLchan b = v0->color[2]; \ - GLchan a = v0->color[3]; \ - (*ctx->Driver.Color)( ctx, r, g, b, a ); \ - } +#define SETUP_CODE #define INNER_LOOP( LEFT, RIGHT, Y ) \ { \ @@ -176,8 +163,7 @@ static void flat_rgba_triangle( GLcontext *ctx, fffog += fdfogdx; \ } \ gl_write_monocolor_span( ctx, n, LEFT, Y, zspan, \ - fogspan, \ - v0->color, \ + fogspan, v0->color, \ GL_POLYGON ); \ } \ } -- cgit v1.2.3