summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_copypix.c
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-06-29 21:29:30 -0600
committerBrian <[email protected]>2007-06-29 21:29:30 -0600
commit9dca42a4a10acbf1980c0f2eafb3e28e11ca1bf3 (patch)
tree719e67ae454bdc1cc0d6960926f0d89a5e2d6499 /src/mesa/swrast/s_copypix.c
parentfb4f4e2d186fac24cafa5e637461042706d4a123 (diff)
Undo some prev glDraw/CopyPixel changes which fixed a bug in which colors were overwritten by interpolating attributes.
Now just set the span->arrayAttribs mask in glDraw/CopyPixels and be sure we don't overwrite the values in interpolate_active_attribs().
Diffstat (limited to 'src/mesa/swrast/s_copypix.c')
-rw-r--r--src/mesa/swrast/s_copypix.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c
index 2383015000a..9cd6ca20a9d 100644
--- a/src/mesa/swrast/s_copypix.c
+++ b/src/mesa/swrast/s_copypix.c
@@ -156,7 +156,7 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
/* write the new image */
for (row = 0; row < height; row++) {
const GLfloat *src = convImage + row * width * 4;
- GLvoid *rgba = (GLvoid *) span.array->attribs[FRAG_ATTRIB_COL0];
+ GLfloat *rgba = (GLfloat *) span.array->attribs[FRAG_ATTRIB_COL0];
/* copy convolved colors into span array */
_mesa_memcpy(rgba, src, width * 4 * sizeof(GLfloat));
@@ -188,8 +188,6 @@ static void
copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
GLint width, GLint height, GLint destx, GLint desty)
{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- const GLbitfield prevActiveAttribs = swrast->_ActiveAttribMask;
GLfloat *tmpImage, *p;
GLint sy, dy, stepy, row;
const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F;
@@ -199,15 +197,12 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
if (!ctx->ReadBuffer->_ColorReadBuffer) {
/* no readbuffer - OK */
- goto end;
+ return;
}
- /* don't interpolate COL0 and overwrite the glDrawPixel colors! */
- swrast->_ActiveAttribMask &= ~FRAG_BIT_COL0;
-
if (ctx->Pixel.Convolution2DEnabled || ctx->Pixel.Separable2DEnabled) {
copy_conv_rgba_pixels(ctx, srcx, srcy, width, height, destx, desty);
- goto end;
+ return;
}
else if (ctx->Pixel.Convolution1DEnabled) {
/* make sure we don't apply 1D convolution */
@@ -239,12 +234,13 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA);
_swrast_span_default_attribs(ctx, &span);
+ span.arrayAttribs = FRAG_BIT_COL0; /* we'll fill in COL0 attrib values */
if (overlapping) {
tmpImage = (GLfloat *) _mesa_malloc(width * height * sizeof(GLfloat) * 4);
if (!tmpImage) {
_mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyPixels" );
- goto end;
+ return;
}
/* read the source image as RGBA/float */
p = tmpImage;
@@ -299,9 +295,6 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
if (overlapping)
_mesa_free(tmpImage);
-
-end:
- swrast->_ActiveAttribMask = prevActiveAttribs;
}