aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/readpix.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-08-16 14:48:54 +0200
committermarha <marha@users.sourceforge.net>2012-08-16 14:48:54 +0200
commit4aac32998c2b173b84aec0b020aa086fef4b1423 (patch)
tree3ffcb971bcc2f01929f60f8f704996544b69b2e1 /mesalib/src/mesa/main/readpix.c
parent9ddf44af81782451cee798e06749ce3067a14a41 (diff)
downloadvcxsrv-4aac32998c2b173b84aec0b020aa086fef4b1423.tar.gz
vcxsrv-4aac32998c2b173b84aec0b020aa086fef4b1423.tar.bz2
vcxsrv-4aac32998c2b173b84aec0b020aa086fef4b1423.zip
libxcb xserver mesa git update 16 Aug 2012
Diffstat (limited to 'mesalib/src/mesa/main/readpix.c')
-rw-r--r--mesalib/src/mesa/main/readpix.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/mesalib/src/mesa/main/readpix.c b/mesalib/src/mesa/main/readpix.c
index 7ac877497..f0bc157d8 100644
--- a/mesalib/src/mesa/main/readpix.c
+++ b/mesalib/src/mesa/main/readpix.c
@@ -322,6 +322,8 @@ slow_read_rgba_pixels( struct gl_context *ctx,
void *rgba;
GLubyte *dst, *map;
int dstStride, stride, j;
+ GLboolean dst_is_integer = _mesa_is_enum_format_integer(format);
+ GLboolean dst_is_uint = _mesa_is_format_unsigned(rbFormat);
dstStride = _mesa_image_row_stride(packing, width, format, type);
dst = (GLubyte *) _mesa_image_address2d(packing, pixels, width, height,
@@ -339,12 +341,17 @@ slow_read_rgba_pixels( struct gl_context *ctx,
goto done;
for (j = 0; j < height; j++) {
- if (_mesa_is_enum_format_integer(format)) {
+ if (dst_is_integer) {
_mesa_unpack_uint_rgba_row(rbFormat, width, map, (GLuint (*)[4]) rgba);
_mesa_rebase_rgba_uint(width, (GLuint (*)[4]) rgba,
rb->_BaseFormat);
- _mesa_pack_rgba_span_int(ctx, width, (GLuint (*)[4]) rgba, format,
- type, dst);
+ if (dst_is_uint) {
+ _mesa_pack_rgba_span_from_uints(ctx, width, (GLuint (*)[4]) rgba, format,
+ type, dst);
+ } else {
+ _mesa_pack_rgba_span_from_ints(ctx, width, (GLint (*)[4]) rgba, format,
+ type, dst);
+ }
} else {
_mesa_unpack_rgba_row(rbFormat, width, map, (GLfloat (*)[4]) rgba);
_mesa_rebase_rgba_float(width, (GLfloat (*)[4]) rgba,