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_buffers.c | 33 ++++++++++----------------------- 1 file changed, 10 insertions(+), 23 deletions(-) (limited to 'src/mesa/swrast/s_buffers.c') diff --git a/src/mesa/swrast/s_buffers.c b/src/mesa/swrast/s_buffers.c index 1b07eb0bef..102d53ac7f 100644 --- a/src/mesa/swrast/s_buffers.c +++ b/src/mesa/swrast/s_buffers.c @@ -1,4 +1,4 @@ -/* $Id: s_buffers.c,v 1.13 2002/10/04 19:10:12 brianp Exp $ */ +/* $Id: s_buffers.c,v 1.14 2002/10/11 17:41:06 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -166,18 +166,7 @@ clear_color_buffers(GLcontext *ctx) /* loop over four possible dest color buffers */ for (bufferBit = 1; bufferBit <= 8; bufferBit = bufferBit << 1) { if (bufferBit & ctx->Color._DrawDestMask) { - 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); - } + (*swrast->Driver.SetBuffer)(ctx, ctx->DrawBuffer, bufferBit); if (colorMask != 0xffffffff) { clear_color_buffer_with_masking(ctx); @@ -274,10 +263,9 @@ _swrast_use_read_buffer( GLcontext *ctx ) SWcontext *swrast = SWRAST_CONTEXT(ctx); /* Do this so the software-emulated alpha plane span functions work! */ - ctx->Color._DriverDrawBuffer = ctx->Pixel._DriverReadBuffer; + swrast->CurrentBuffer = ctx->Pixel._ReadSrcMask; /* Tell the device driver where to read/write spans */ - (*swrast->Driver.SetBuffer)( ctx, ctx->ReadBuffer, - ctx->Pixel._DriverReadBuffer ); + (*swrast->Driver.SetBuffer)( ctx, ctx->ReadBuffer, swrast->CurrentBuffer ); } @@ -302,17 +290,16 @@ _swrast_use_draw_buffer( GLcontext *ctx ) */ if (ctx->Color._DrawDestMask & FRONT_LEFT_BIT) - ctx->Color._DriverDrawBuffer = GL_FRONT_LEFT; + swrast->CurrentBuffer = FRONT_LEFT_BIT; else if (ctx->Color._DrawDestMask & BACK_LEFT_BIT) - ctx->Color._DriverDrawBuffer = GL_BACK_LEFT; + swrast->CurrentBuffer = BACK_LEFT_BIT; else if (ctx->Color._DrawDestMask & FRONT_RIGHT_BIT) - ctx->Color._DriverDrawBuffer = GL_FRONT_RIGHT; + swrast->CurrentBuffer = FRONT_RIGHT_BIT; else if (ctx->Color._DrawDestMask & BACK_RIGHT_BIT) - ctx->Color._DriverDrawBuffer = GL_BACK_RIGHT; + swrast->CurrentBuffer = BACK_RIGHT_BIT; else /* glDrawBuffer(GL_NONE) */ - ctx->Color._DriverDrawBuffer = GL_FRONT_LEFT; /* always have this */ + swrast->CurrentBuffer = FRONT_LEFT_BIT; /* we always have this buffer */ - (*swrast->Driver.SetBuffer)( ctx, ctx->DrawBuffer, - ctx->Color._DriverDrawBuffer ); + (*swrast->Driver.SetBuffer)( ctx, ctx->DrawBuffer, swrast->CurrentBuffer ); } -- cgit v1.2.3