From 8ad1076dc2afda8ed37e5a9f6a757583eba90375 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 11 Oct 2002 17:41:03 +0000 Subject: Another round of glRead/DrawBuffer() clean-ups and simplifications. Replaced ctx->Color._DriverDrawBuffer with swrast->CurrentBuffer. Replaced ctx->Pixel._DriverReadBuffer with ctx->Pixel._ReadSrcMask. swrast->Driver.SetBuffer() takes FRONT/BACK_LEFT/RIGHT_BIT values now. Added tokens and code for GL_AUX buffers, for completeness. --- src/mesa/swrast/s_span.c | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 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 b134890a3b..2628a7af3e 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.48 2002/10/02 23:24:04 brianp Exp $ */ +/* $Id: s_span.c,v 1.49 2002/10/11 17:41:06 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -618,14 +618,9 @@ multi_write_index_span( GLcontext *ctx, struct sw_span *span ) GLuint indexTmp[MAX_WIDTH]; ASSERT(span->end < MAX_WIDTH); - if (bufferBit == FRONT_LEFT_BIT) - (*swrast->Driver.SetBuffer)(ctx, ctx->DrawBuffer, GL_FRONT_LEFT); - else if (bufferBit == FRONT_RIGHT_BIT) - (*swrast->Driver.SetBuffer)(ctx, ctx->DrawBuffer, GL_FRONT_RIGHT); - else if (bufferBit == BACK_LEFT_BIT) - (*swrast->Driver.SetBuffer)(ctx, ctx->DrawBuffer, GL_BACK_LEFT); - else - (*swrast->Driver.SetBuffer)(ctx, ctx->DrawBuffer, GL_BACK_RIGHT); + /* Set the current read/draw buffer */ + swrast->CurrentBuffer = bufferBit; + (*swrast->Driver.SetBuffer)(ctx, ctx->DrawBuffer, bufferBit); /* make copy of incoming indexes */ MEMCPY( indexTmp, span->array->index, span->end * sizeof(GLuint) ); @@ -680,22 +675,9 @@ multi_write_rgba_span( GLcontext *ctx, struct sw_span *span ) GLchan rgbaTmp[MAX_WIDTH][4]; ASSERT(span->end < MAX_WIDTH); - if (bufferBit == FRONT_LEFT_BIT) { - ctx->Color._DriverDrawBuffer = GL_FRONT_LEFT; - (*swrast->Driver.SetBuffer)(ctx, ctx->DrawBuffer, GL_FRONT_LEFT); - } - else if (bufferBit == FRONT_RIGHT_BIT) { - ctx->Color._DriverDrawBuffer = GL_FRONT_RIGHT; - (*swrast->Driver.SetBuffer)(ctx, ctx->DrawBuffer, GL_FRONT_RIGHT); - } - else if (bufferBit == BACK_LEFT_BIT) { - ctx->Color._DriverDrawBuffer = GL_BACK_LEFT; - (*swrast->Driver.SetBuffer)(ctx, ctx->DrawBuffer, GL_BACK_LEFT); - } - else { - ctx->Color._DriverDrawBuffer = GL_BACK_RIGHT; - (*swrast->Driver.SetBuffer)(ctx, ctx->DrawBuffer, GL_BACK_RIGHT); - } + /* Set the current read/draw buffer */ + swrast->CurrentBuffer = bufferBit; + (*swrast->Driver.SetBuffer)(ctx, ctx->DrawBuffer, bufferBit); /* make copy of incoming colors */ MEMCPY( rgbaTmp, span->array->rgba, 4 * span->end * sizeof(GLchan) ); -- cgit v1.2.3