summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_readpix.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2006-10-13 17:41:23 +0000
committerBrian Paul <[email protected]>2006-10-13 17:41:23 +0000
commit5b0edff412f45fe64bd42fb481adeda7d34b0fa8 (patch)
tree141c7825eb0f289f69a4fc5fb206e6c7415d51c7 /src/mesa/swrast/s_readpix.c
parent461651357713b1408400669d6a809f2e367182fe (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_readpix.c')
-rw-r--r--src/mesa/swrast/s_readpix.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c
index fb39427b621..0189b0e797d 100644
--- a/src/mesa/swrast/s_readpix.c
+++ b/src/mesa/swrast/s_readpix.c
@@ -309,6 +309,7 @@ read_rgba_pixels( GLcontext *ctx,
const struct gl_pixelstore_attrib *packing )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ const GLbitfield transferOps = ctx->_ImageTransferState;
struct gl_framebuffer *fb = ctx->ReadBuffer;
struct gl_renderbuffer *rb = fb->_ColorReadBuffer;
@@ -324,7 +325,6 @@ read_rgba_pixels( GLcontext *ctx,
ASSERT(width <= MAX_WIDTH);
if (ctx->Pixel.Convolution2DEnabled || ctx->Pixel.Separable2DEnabled) {
- const GLbitfield transferOps = ctx->_ImageTransferState;
GLfloat *dest, *src, *tmpImage, *convImage;
GLint row;
@@ -350,9 +350,9 @@ read_rgba_pixels( GLcontext *ctx,
GLuint index[MAX_WIDTH];
ASSERT(rb->DataType == GL_UNSIGNED_INT);
rb->GetRow(ctx, rb, width, x, y, index);
- if (ctx->Pixel.IndexShift != 0 || ctx->Pixel.IndexOffset !=0 ) {
- _mesa_map_ci(ctx, width, index);
- }
+ _mesa_apply_ci_transfer_ops(ctx,
+ transferOps & IMAGE_SHIFT_OFFSET_BIT,
+ width, index);
_mesa_map_ci_to_rgba(ctx, width, index, (GLfloat (*)[4]) dest);
}
_mesa_apply_rgba_transfer_ops(ctx,
@@ -404,9 +404,9 @@ read_rgba_pixels( GLcontext *ctx,
GLuint index[MAX_WIDTH];
ASSERT(rb->DataType == GL_UNSIGNED_INT);
rb->GetRow(ctx, rb, width, x, y, index);
- if (ctx->Pixel.IndexShift != 0 || ctx->Pixel.IndexOffset != 0) {
- _mesa_map_ci(ctx, width, index);
- }
+ _mesa_apply_ci_transfer_ops(ctx,
+ transferOps & IMAGE_SHIFT_OFFSET_BIT,
+ width, index);
_mesa_map_ci_to_rgba(ctx, width, index, rgba);
}