aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/accum.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2000-09-07 15:45:26 +0000
committerBrian Paul <[email protected]>2000-09-07 15:45:26 +0000
commitc4c639c9a46967678725370cb9824031a068633c (patch)
treef0008c2a00c6f5f65cc4800b87a560a39551b569 /src/mesa/main/accum.c
parent18f73b622ffa1d1cebea5556b9ebe53a9adc31ac (diff)
Removed ctx->Driver.LogicOp().
ctx->Driver.Index/ColorMask() now return void. Removed SWmasking and SWLogicOpEnabled variables. LogicOps and color/index masking are no longer special-case device driver functions. The Xlib driver was the only driver that used them. Things are more uniform now.
Diffstat (limited to 'src/mesa/main/accum.c')
-rw-r--r--src/mesa/main/accum.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mesa/main/accum.c b/src/mesa/main/accum.c
index 79733d6aca3..7b2f1ca57ee 100644
--- a/src/mesa/main/accum.c
+++ b/src/mesa/main/accum.c
@@ -1,4 +1,4 @@
-/* $Id: accum.c,v 1.23 2000/07/15 03:14:25 brianp Exp $ */
+/* $Id: accum.c,v 1.24 2000/09/07 15:45:26 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -140,6 +140,7 @@ _mesa_Accum( GLenum op, GLfloat value )
GLuint xpos, ypos, width, height, width4;
GLfloat acc_scale;
GLubyte rgba[MAX_WIDTH][4];
+ const GLuint colorMask = *((GLuint *) &ctx->Color.ColorMask);
const GLint iChanMax = (1 << (sizeof(GLchan) * 8)) - 1;
const GLfloat fChanMax = (1 << (sizeof(GLchan) * 8)) - 1;
@@ -350,11 +351,11 @@ _mesa_Accum( GLenum op, GLfloat value )
if (ctx->IntegerAccumMode && ctx->IntegerAccumScaler > 0) {
/* build lookup table to avoid many floating point multiplies */
- const GLfloat mult = ctx->IntegerAccumScaler;
static GLchan multTable[32768];
static GLfloat prevMult = 0.0;
- GLuint j;
+ const GLfloat mult = ctx->IntegerAccumScaler;
const GLint max = MIN2((GLint) (256 / mult), 32767);
+ GLuint j;
if (mult != prevMult) {
for (j = 0; j < max; j++)
multTable[j] = (GLint) ((GLfloat) j * mult + 0.5F);
@@ -376,7 +377,7 @@ _mesa_Accum( GLenum op, GLfloat value )
rgba[i][BCOMP] = multTable[acc[i4+2]];
rgba[i][ACOMP] = multTable[acc[i4+3]];
}
- if (ctx->Color.SWmasking) {
+ if (colorMask != 0xffffffff) {
_mesa_mask_rgba_span( ctx, width, xpos, ypos, rgba );
}
(*ctx->Driver.WriteRGBASpan)( ctx, width, xpos, ypos,
@@ -403,7 +404,7 @@ _mesa_Accum( GLenum op, GLfloat value )
rgba[i][BCOMP] = CLAMP( b, 0, iChanMax );
rgba[i][ACOMP] = CLAMP( a, 0, iChanMax );
}
- if (ctx->Color.SWmasking) {
+ if (colorMask != 0xffffffff) {
_mesa_mask_rgba_span( ctx, width, xpos, ypos, rgba );
}
(*ctx->Driver.WriteRGBASpan)( ctx, width, xpos, ypos,