diff options
author | Eric Anholt <[email protected]> | 2007-06-21 14:14:24 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2007-06-21 14:14:24 -0700 |
commit | 4fe48b4e8568896cdbc822323aeec0a41c72ff2a (patch) | |
tree | a32edaa514931bad2364b3877302eeaa3847131e /src/mesa/swrast/s_copypix.c | |
parent | 5d9dc02cbecd94f822f853fd01878784596f4eba (diff) | |
parent | ed5ed6fe2f64f45eb3a43f9c57037d9e9b7fa5ea (diff) |
Merge branch 'origin' into i915-unification
Diffstat (limited to 'src/mesa/swrast/s_copypix.c')
-rw-r--r-- | src/mesa/swrast/s_copypix.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c index 53e584b3b6b..2383015000a 100644 --- a/src/mesa/swrast/s_copypix.c +++ b/src/mesa/swrast/s_copypix.c @@ -188,6 +188,8 @@ 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; @@ -197,12 +199,15 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, if (!ctx->ReadBuffer->_ColorReadBuffer) { /* no readbuffer - OK */ - return; + goto end; } + /* 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); - return; + goto end; } else if (ctx->Pixel.Convolution1DEnabled) { /* make sure we don't apply 1D convolution */ @@ -239,7 +244,7 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, tmpImage = (GLfloat *) _mesa_malloc(width * height * sizeof(GLfloat) * 4); if (!tmpImage) { _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyPixels" ); - return; + goto end; } /* read the source image as RGBA/float */ p = tmpImage; @@ -294,6 +299,9 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, if (overlapping) _mesa_free(tmpImage); + +end: + swrast->_ActiveAttribMask = prevActiveAttribs; } |