diff options
author | Brian Paul <[email protected]> | 2006-10-13 17:41:23 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2006-10-13 17:41:23 +0000 |
commit | 5b0edff412f45fe64bd42fb481adeda7d34b0fa8 (patch) | |
tree | 141c7825eb0f289f69a4fc5fb206e6c7415d51c7 /src/mesa/swrast/s_copypix.c | |
parent | 461651357713b1408400669d6a809f2e367182fe (diff) |
Consolidate, move, fix code related to color index and stencil image transfer
operations (shift, offset, table lookup, etc).
Diffstat (limited to 'src/mesa/swrast/s_copypix.c')
-rw-r--r-- | src/mesa/swrast/s_copypix.c | 30 |
1 files changed, 5 insertions, 25 deletions
diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c index accf59f3076..1a17b75c702 100644 --- a/src/mesa/swrast/s_copypix.c +++ b/src/mesa/swrast/s_copypix.c @@ -312,7 +312,6 @@ copy_ci_pixels( GLcontext *ctx, GLint srcx, GLint srcy, GLint sy, dy, stepy; GLint j; const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F; - const GLboolean shift_or_offset = ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset; GLint overlapping; SWspan span; @@ -382,13 +381,9 @@ copy_ci_pixels( GLcontext *ctx, GLint srcx, GLint srcy, width, srcx, sy, span.array->index ); } - /* Apply shift, offset, look-up table */ - if (shift_or_offset) { - _mesa_shift_and_offset_ci( ctx, width, span.array->index ); - } - if (ctx->Pixel.MapColorFlag) { - _mesa_map_ci( ctx, width, span.array->index ); - } + if (ctx->_ImageTransferState) + _mesa_apply_ci_transfer_ops(ctx, ctx->_ImageTransferState, + width, span.array->index); /* write color indexes */ span.x = destx; @@ -561,7 +556,6 @@ copy_stencil_pixels( GLcontext *ctx, GLint srcx, GLint srcy, GLint j; GLstencil *p, *tmpImage; const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F; - const GLboolean shift_or_offset = ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset; GLint overlapping; if (!rb) { @@ -622,13 +616,7 @@ copy_stencil_pixels( GLcontext *ctx, GLint srcx, GLint srcy, _swrast_read_stencil_span( ctx, rb, width, srcx, sy, stencil ); } - /* Apply shift, offset, look-up table */ - if (shift_or_offset) { - _mesa_shift_and_offset_stencil( ctx, width, stencil ); - } - if (ctx->Pixel.MapStencilFlag) { - _mesa_map_stencil( ctx, width, stencil ); - } + _mesa_apply_stencil_transfer_ops(ctx, width, stencil); /* Write stencil values */ if (zoom) { @@ -664,8 +652,6 @@ copy_depth_stencil_pixels(GLcontext *ctx, const GLfloat depthScale = ctx->DrawBuffer->_DepthMaxF; const GLuint stencilMask = ctx->Stencil.WriteMask[0]; const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F; - const GLboolean shiftOrOffset - = ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset; const GLboolean scaleOrBias = ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0; GLint overlapping; @@ -755,13 +741,7 @@ copy_depth_stencil_pixels(GLcontext *ctx, width, srcX, sy, stencil); } - /* Apply shift, offset, look-up table */ - if (shiftOrOffset) { - _mesa_shift_and_offset_stencil(ctx, width, stencil); - } - if (ctx->Pixel.MapStencilFlag) { - _mesa_map_stencil(ctx, width, stencil); - } + _mesa_apply_stencil_transfer_ops(ctx, width, stencil); /* Write values */ if (zoom) { |