summaryrefslogtreecommitdiff
path: root/src/mesa/swrast/s_readpix.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/swrast/s_readpix.c')
-rw-r--r--src/mesa/swrast/s_readpix.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c
index 6186f92899..8fa95ded18 100644
--- a/src/mesa/swrast/s_readpix.c
+++ b/src/mesa/swrast/s_readpix.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.3
+ * Version: 7.0.3
*
* Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
*
@@ -129,7 +129,8 @@ read_depth_pixels( GLcontext *ctx,
rb->GetRow(ctx, rb, width, x, y, dest);
/* convert range from 24-bit to 32-bit */
for (k = 0; k < width; k++) {
- dest[k] = (dest[k] << 8) | (dest[k] >> 24);
+ /* Note: put MSByte of 24-bit value into LSByte */
+ dest[k] = (dest[k] << 8) | ((dest[k] >> 16) & 0xff);
}
}
}
@@ -569,13 +570,14 @@ _swrast_ReadPixels( GLcontext *ctx,
/* Do all needed clipping here, so that we can forget about it later */
if (!_mesa_clip_readpixels(ctx, &x, &y, &width, &height, &clippedPacking)) {
/* The ReadPixels region is totally outside the window bounds */
- goto end;
+ RENDER_FINISH(swrast, ctx);
+ return;
}
pixels = _mesa_map_readpix_pbo(ctx, &clippedPacking, pixels);
if (!pixels)
return;
-
+
switch (format) {
case GL_COLOR_INDEX:
read_index_pixels(ctx, x, y, width, height, type, pixels,
@@ -612,8 +614,6 @@ _swrast_ReadPixels( GLcontext *ctx,
/* don't return yet, clean-up */
}
-
-end:
RENDER_FINISH(swrast, ctx);
_mesa_unmap_readpix_pbo(ctx, &clippedPacking);