/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
CLAMPED_FLOAT_TO_CHAN(clearColor[ACOMP], ctx->Color.ClearColor[3]);
for (i = 0; i < height; i++) {
+ struct sw_span span;
GLchan rgba[MAX_WIDTH][4];
GLint j;
for (j = 0; j < width; j++) {
COPY_CHAN4(rgba[j], clearColor);
}
- _swrast_mask_rgba_array( ctx, rb, width, x, y + i, rgba );
+ /* setup span struct for masking */
+ INIT_SPAN(span, GL_BITMAP, width, 0, SPAN_RGBA);
+ span.x = x;
+ span.y = y + i;
+ _swrast_mask_rgba_span(ctx, rb, &span, rgba);
+ /* write masked row */
rb->PutRow(ctx, rb, width, x, y + i, rgba, NULL);
}
}
ASSERT(rb->DataType == GL_UNSIGNED_INT);
for (i = 0; i < height;i++) {
- GLuint span[MAX_WIDTH];
+ struct sw_span span;
+ GLuint indexes[MAX_WIDTH];
GLint j;
for (j = 0; j < width;j++) {
- span[j] = ctx->Color.ClearIndex;
+ indexes[j] = ctx->Color.ClearIndex;
}
- _swrast_mask_ci_array(ctx, rb, width, x, y + i, span);
- rb->PutRow(ctx, rb, width, x, y + i, span, NULL);
+ /* setup span struct for masking */
+ INIT_SPAN(span, GL_BITMAP, width, 0, SPAN_RGBA);
+ span.x = x;
+ span.y = y + i;
+ _swrast_mask_ci_span(ctx, rb, &span, indexes);
+ /* write masked row */
+ rb->PutRow(ctx, rb, width, x, y + i, indexes, NULL);
}
}
ASSERT(!ctx->Visual.rgbMode);
- ASSERT((ctx->Color.IndexMask & ((1 << ctx->Visual.indexBits) - 1))
- == (GLuint) ((1 << ctx->Visual.indexBits) - 1));
+ ASSERT((ctx->Color.IndexMask & ((1 << rb->IndexBits) - 1))
+ == (GLuint) ((1 << rb->IndexBits) - 1));
ASSERT(rb->PutMonoRow);
}
}
else {
- const GLuint indexBits = (1 << ctx->Visual.indexBits) - 1;
+ struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0][0];
+ const GLuint indexBits = (1 << rb->IndexBits) - 1;
if ((ctx->Color.IndexMask & indexBits) == indexBits) {
masking = GL_FALSE;
}
clear_color_buffers(ctx);
}
if (mask & BUFFER_BIT_DEPTH) {
- struct gl_renderbuffer *rb
- = ctx->DrawBuffer->Attachment[BUFFER_DEPTH].Renderbuffer;
- _swrast_clear_depth_buffer(ctx, rb);
+ _swrast_clear_depth_buffer(ctx, ctx->DrawBuffer->_DepthBuffer);
}
if (mask & BUFFER_BIT_ACCUM) {
- struct gl_renderbuffer *rb
- = ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer;
- _swrast_clear_accum_buffer(ctx, rb);
+ _swrast_clear_accum_buffer(ctx,
+ ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer);
}
if (mask & BUFFER_BIT_STENCIL) {
- struct gl_renderbuffer *rb
- = ctx->DrawBuffer->Attachment[BUFFER_STENCIL].Renderbuffer;
- _swrast_clear_stencil_buffer(ctx, rb);
+ _swrast_clear_stencil_buffer(ctx, ctx->DrawBuffer->_StencilBuffer);
}
}