diff options
author | Brian <[email protected]> | 2007-06-29 21:29:30 -0600 |
---|---|---|
committer | Brian <[email protected]> | 2007-06-29 21:29:30 -0600 |
commit | 9dca42a4a10acbf1980c0f2eafb3e28e11ca1bf3 (patch) | |
tree | 719e67ae454bdc1cc0d6960926f0d89a5e2d6499 /src/mesa/swrast/s_drawpix.c | |
parent | fb4f4e2d186fac24cafa5e637461042706d4a123 (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_drawpix.c')
-rw-r--r-- | src/mesa/swrast/s_drawpix.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c index 925358d77eb..b5388745bab 100644 --- a/src/mesa/swrast/s_drawpix.c +++ b/src/mesa/swrast/s_drawpix.c @@ -532,25 +532,21 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y, const struct gl_pixelstore_attrib *unpack, const GLvoid *pixels ) { - SWcontext *swrast = SWRAST_CONTEXT(ctx); - const GLbitfield prevActiveAttribs = swrast->_ActiveAttribMask; const GLint imgX = x, imgY = y; const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0; GLfloat *convImage = NULL; GLbitfield transferOps = ctx->_ImageTransferState; SWspan span; - /* don't interpolate COL0 and overwrite the glDrawPixel colors! */ - swrast->_ActiveAttribMask &= ~FRAG_BIT_COL0; - /* Try an optimized glDrawPixels first */ if (fast_draw_rgba_pixels(ctx, x, y, width, height, format, type, unpack, pixels)) { - goto end; + return; } INIT_SPAN(span, GL_BITMAP, 0, 0x0, SPAN_RGBA); _swrast_span_default_attribs(ctx, &span); + span.arrayAttribs = FRAG_BIT_COL0; /* we're fill in COL0 attrib values */ if (ctx->Pixel.Convolution2DEnabled || ctx->Pixel.Separable2DEnabled) { /* Convolution has to be handled specially. We'll create an @@ -565,13 +561,13 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y, tmpImage = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); if (!tmpImage) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glDrawPixels"); - goto end; + return; } convImage = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); if (!convImage) { _mesa_free(tmpImage); _mesa_error(ctx, GL_OUT_OF_MEMORY, "glDrawPixels"); - goto end; + return; } /* Unpack the image and apply transfer ops up to convolution */ @@ -675,9 +671,6 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y, if (convImage) { _mesa_free(convImage); } - -end: - swrast->_ActiveAttribMask = prevActiveAttribs; } |