From 3b4fbbc129c711a5aec8d653d5c6eb2e195f947c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 9 Jul 2002 01:22:50 +0000 Subject: Overhaul of glRead/DrawBuffer() code. Now, swrast->Driver.SetBuffer() indicates the read AND draw color buffer for all software rasterization. Lots of related clean-ups. See RELNOTES-4.1 for details. --- src/mesa/swrast/s_span.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'src/mesa/swrast/s_span.c') diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index a3271d7806..94cd4a9ce8 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.44 2002/06/15 03:03:11 brianp Exp $ */ +/* $Id: s_span.c,v 1.45 2002/07/09 01:22:52 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -608,19 +608,19 @@ multi_write_index_span( GLcontext *ctx, struct sw_span *span ) GLuint bufferBit; /* loop over four possible dest color buffers */ - for (bufferBit = 1; bufferBit <= 8; bufferBit = bufferBit << 1) { - if (bufferBit & ctx->Color.DrawDestMask) { + for (bufferBit = 1; bufferBit <= 8; bufferBit <<= 1) { + if (bufferBit & ctx->Color._DrawDestMask) { GLuint indexTmp[MAX_WIDTH]; ASSERT(span->end < MAX_WIDTH); if (bufferBit == FRONT_LEFT_BIT) - (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_FRONT_LEFT); + (*swrast->Driver.SetBuffer)(ctx, ctx->DrawBuffer, GL_FRONT_LEFT); else if (bufferBit == FRONT_RIGHT_BIT) - (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_FRONT_RIGHT); + (*swrast->Driver.SetBuffer)(ctx, ctx->DrawBuffer, GL_FRONT_RIGHT); else if (bufferBit == BACK_LEFT_BIT) - (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_BACK_LEFT); + (*swrast->Driver.SetBuffer)(ctx, ctx->DrawBuffer, GL_BACK_LEFT); else - (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_BACK_RIGHT); + (*swrast->Driver.SetBuffer)(ctx, ctx->DrawBuffer, GL_BACK_RIGHT); /* make copy of incoming indexes */ MEMCPY( indexTmp, span->color.index, span->end * sizeof(GLuint) ); @@ -648,7 +648,7 @@ multi_write_index_span( GLcontext *ctx, struct sw_span *span ) } /* restore default dest buffer */ - (void) (*ctx->Driver.SetDrawBuffer)( ctx, ctx->Color.DriverDrawBuffer); + _swrast_use_draw_buffer(ctx); } @@ -670,26 +670,26 @@ multi_write_rgba_span( GLcontext *ctx, struct sw_span *span ) return; /* loop over four possible dest color buffers */ - for (bufferBit = 1; bufferBit <= 8; bufferBit = bufferBit << 1) { - if (bufferBit & ctx->Color.DrawDestMask) { + for (bufferBit = 1; bufferBit <= 8; bufferBit <<= 1) { + if (bufferBit & ctx->Color._DrawDestMask) { GLchan rgbaTmp[MAX_WIDTH][4]; ASSERT(span->end < MAX_WIDTH); if (bufferBit == FRONT_LEFT_BIT) { - (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_FRONT_LEFT); - ctx->DrawBuffer->Alpha = ctx->DrawBuffer->FrontLeftAlpha; + ctx->Color._DriverDrawBuffer = GL_FRONT_LEFT; + (*swrast->Driver.SetBuffer)(ctx, ctx->DrawBuffer, GL_FRONT_LEFT); } else if (bufferBit == FRONT_RIGHT_BIT) { - (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_FRONT_RIGHT); - ctx->DrawBuffer->Alpha = ctx->DrawBuffer->FrontRightAlpha; + ctx->Color._DriverDrawBuffer = GL_FRONT_RIGHT; + (*swrast->Driver.SetBuffer)(ctx, ctx->DrawBuffer, GL_FRONT_RIGHT); } else if (bufferBit == BACK_LEFT_BIT) { - (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_BACK_LEFT); - ctx->DrawBuffer->Alpha = ctx->DrawBuffer->BackLeftAlpha; + ctx->Color._DriverDrawBuffer = GL_BACK_LEFT; + (*swrast->Driver.SetBuffer)(ctx, ctx->DrawBuffer, GL_BACK_LEFT); } else { - (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_BACK_RIGHT); - ctx->DrawBuffer->Alpha = ctx->DrawBuffer->BackRightAlpha; + ctx->Color._DriverDrawBuffer = GL_BACK_RIGHT; + (*swrast->Driver.SetBuffer)(ctx, ctx->DrawBuffer, GL_BACK_RIGHT); } /* make copy of incoming colors */ @@ -734,7 +734,7 @@ multi_write_rgba_span( GLcontext *ctx, struct sw_span *span ) } /* restore default dest buffer */ - (void) (*ctx->Driver.SetDrawBuffer)( ctx, ctx->Color.DriverDrawBuffer ); + _swrast_use_draw_buffer(ctx); } -- cgit v1.2.3