summaryrefslogtreecommitdiff
path: root/src/mesa/swrast/s_span.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2002-10-11 17:41:03 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2002-10-11 17:41:03 +0000
commit8ad1076dc2afda8ed37e5a9f6a757583eba90375 (patch)
tree30bc52e2db6e089972d441a53c070e8377cb684d /src/mesa/swrast/s_span.c
parent9e84910749744efcba06670f622cc00d279f26f1 (diff)
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.
Diffstat (limited to 'src/mesa/swrast/s_span.c')
-rw-r--r--src/mesa/swrast/s_span.c32
1 files changed, 7 insertions, 25 deletions
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) );