diff options
author | marha <marha@users.sourceforge.net> | 2012-01-06 19:27:25 +0100 |
---|---|---|
committer | Marc Haesen <marc@hc-consult.be> | 2012-01-06 19:27:25 +0100 |
commit | 7e9f4ea970e8f7008c212d7d3918a974eb0066da (patch) | |
tree | 92cf7fcdf6e8093e743346af2397f3caa17cffe3 /mesalib/src/mesa/swrast/s_copypix.c | |
parent | 9715b7fab0757c86e1bb151f3dce0b324bcff692 (diff) | |
download | vcxsrv-7e9f4ea970e8f7008c212d7d3918a974eb0066da.tar.gz vcxsrv-7e9f4ea970e8f7008c212d7d3918a974eb0066da.tar.bz2 vcxsrv-7e9f4ea970e8f7008c212d7d3918a974eb0066da.zip |
libX11 mesa pixman git update 6 jan 2012
Diffstat (limited to 'mesalib/src/mesa/swrast/s_copypix.c')
-rw-r--r-- | mesalib/src/mesa/swrast/s_copypix.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/mesalib/src/mesa/swrast/s_copypix.c b/mesalib/src/mesa/swrast/s_copypix.c index 1dc4286a3..1e0f9fe7d 100644 --- a/mesalib/src/mesa/swrast/s_copypix.c +++ b/mesalib/src/mesa/swrast/s_copypix.c @@ -422,13 +422,13 @@ copy_stencil_pixels( struct gl_context *ctx, GLint srcx, GLint srcy, /** - * Try to do a fast copy pixels with memcpy. + * Try to do a fast 1:1 blit with memcpy. * \return GL_TRUE if successful, GL_FALSE otherwise. */ -static GLboolean -fast_copy_pixels(struct gl_context *ctx, - GLint srcX, GLint srcY, GLsizei width, GLsizei height, - GLint dstX, GLint dstY, GLenum type) +GLboolean +swrast_fast_copy_pixels(struct gl_context *ctx, + GLint srcX, GLint srcY, GLsizei width, GLsizei height, + GLint dstX, GLint dstY, GLenum type) { struct gl_framebuffer *srcFb = ctx->ReadBuffer; struct gl_framebuffer *dstFb = ctx->DrawBuffer; @@ -438,14 +438,6 @@ fast_copy_pixels(struct gl_context *ctx, GLubyte *srcMap, *dstMap; GLint srcRowStride, dstRowStride; - if (SWRAST_CONTEXT(ctx)->_RasterMask != 0x0 || - ctx->Pixel.ZoomX != 1.0F || - ctx->Pixel.ZoomY != 1.0F || - ctx->_ImageTransferState) { - /* can't handle these */ - return GL_FALSE; - } - if (type == GL_COLOR) { if (dstFb->_NumColorDrawBuffers != 1) return GL_FALSE; @@ -508,7 +500,7 @@ fast_copy_pixels(struct gl_context *ctx, srcRb->Width, srcRb->Height, GL_MAP_READ_BIT | GL_MAP_WRITE_BIT, &map, &rowStride); - if (!srcMap) { + if (!map) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyPixels"); return GL_TRUE; /* don't retry with slow path */ } @@ -582,7 +574,12 @@ _swrast_CopyPixels( struct gl_context *ctx, if (swrast->NewState) _swrast_validate_derived( ctx ); - if (fast_copy_pixels(ctx, srcx, srcy, width, height, destx, desty, type)) { + if (!(SWRAST_CONTEXT(ctx)->_RasterMask != 0x0 || + ctx->Pixel.ZoomX != 1.0F || + ctx->Pixel.ZoomY != 1.0F || + ctx->_ImageTransferState) && + swrast_fast_copy_pixels(ctx, srcx, srcy, width, height, destx, desty, + type)) { /* all done */ return; } |