-/* $Id: s_accum.c,v 1.18 2002/07/09 01:22:52 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "glheader.h"
#include "context.h"
#include "macros.h"
-#include "mmath.h"
-#include "mem.h"
+#include "imports.h"
#include "s_accum.h"
#include "s_alphabuf.h"
void
-_mesa_alloc_accum_buffer( GLframebuffer *buffer )
+_swrast_alloc_accum_buffer( GLframebuffer *buffer )
{
GET_CURRENT_CONTEXT(ctx);
GLint n;
* Clear the accumulation Buffer.
*/
void
-_mesa_clear_accum_buffer( GLcontext *ctx )
+_swarst_clear_accum_buffer( GLcontext *ctx )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLuint buffersize;
ctx->Accum.ClearColor[2]==0.0 &&
ctx->Accum.ClearColor[3]==0.0) {
/* Black */
- BZERO( ctx->DrawBuffer->Accum, buffersize * 4 * sizeof(GLaccum) );
+ _mesa_bzero( ctx->DrawBuffer->Accum,
+ buffersize * 4 * sizeof(GLaccum) );
}
else {
/* Not black */
for (j = 0; j < height; j++) {
GLint i, i4;
- _mesa_read_rgba_span(ctx, ctx->DrawBuffer, width, xpos, ypos, rgba);
+ _swrast_read_rgba_span(ctx, ctx->DrawBuffer, width, xpos, ypos, rgba);
for (i = i4 = 0; i < width; i++, i4+=4) {
acc[i4+0] += rgba[i][RCOMP];
acc[i4+1] += rgba[i][GCOMP];
for (j=0;j<height;j++) {
GLaccum *acc = ctx->DrawBuffer->Accum + ypos * width4 + xpos * 4;
GLint i;
- _mesa_read_rgba_span(ctx, ctx->DrawBuffer, width, xpos, ypos, rgba);
+ _swrast_read_rgba_span(ctx, ctx->DrawBuffer, width, xpos, ypos, rgba);
for (i=0;i<width;i++) {
acc[0] += (GLaccum) ( (GLfloat) rgba[i][RCOMP] * rscale );
acc[1] += (GLaccum) ( (GLfloat) rgba[i][GCOMP] * gscale );
assert(swrast->_IntegerAccumScaler <= 1.0);
for (j = 0; j < height; j++) {
GLint i, i4;
- _mesa_read_rgba_span(ctx, ctx->DrawBuffer, width, xpos, ypos, rgba);
+ _swrast_read_rgba_span(ctx, ctx->DrawBuffer, width, xpos, ypos, rgba);
for (i = i4 = 0; i < width; i++, i4 += 4) {
acc[i4+0] = rgba[i][RCOMP];
acc[i4+1] = rgba[i][GCOMP];
GLint i, j;
for (j = 0; j < height; j++) {
GLaccum *acc = ctx->DrawBuffer->Accum + ypos * width4 + xpos * 4;
- _mesa_read_rgba_span(ctx, ctx->DrawBuffer, width, xpos, ypos, rgba);
+ _swrast_read_rgba_span(ctx, ctx->DrawBuffer, width, xpos, ypos, rgba);
for (i=0;i<width;i++) {
#if 0
*acc++ = (GLaccum) ((GLfloat) rgba[i][RCOMP] * rscale + d);
rgba[i][ACOMP] = multTable[acc[i4+3]];
}
if (colorMask != 0xffffffff) {
- _mesa_mask_rgba_array( ctx, width, xpos, ypos, rgba );
+ _swrast_mask_rgba_array( ctx, width, xpos, ypos, rgba );
}
(*swrast->Driver.WriteRGBASpan)( ctx, width, xpos, ypos,
(const GLchan (*)[4])rgba, NULL );
if (ctx->DrawBuffer->UseSoftwareAlphaBuffers
&& ctx->Color.ColorMask[ACOMP]) {
- _mesa_write_alpha_span(ctx, width, xpos, ypos,
+ _swrast_write_alpha_span(ctx, width, xpos, ypos,
(CONST GLchan (*)[4]) rgba, NULL);
}
ypos++;
rgba[i][ACOMP] = CLAMP( a, 0, CHAN_MAX );
}
if (colorMask != 0xffffffff) {
- _mesa_mask_rgba_array( ctx, width, xpos, ypos, rgba );
+ _swrast_mask_rgba_array( ctx, width, xpos, ypos, rgba );
}
(*swrast->Driver.WriteRGBASpan)( ctx, width, xpos, ypos,
(const GLchan (*)[4])rgba, NULL );
if (ctx->DrawBuffer->UseSoftwareAlphaBuffers
&& ctx->Color.ColorMask[ACOMP]) {
- _mesa_write_alpha_span(ctx, width, xpos, ypos,
+ _swrast_write_alpha_span(ctx, width, xpos, ypos,
(CONST GLchan (*)[4]) rgba, NULL);
}
ypos++;