aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-03-30 20:51:05 +0000
committermarha <marha@users.sourceforge.net>2011-03-30 20:51:05 +0000
commit70a13fe295183aeea369adcb94f2d67e69fab387 (patch)
treed707644ab424d0517a879b9784a543a899e1ae20 /mesalib/src/mesa/main
parent9b51ee5bcf948185cfcba0600b3da2d241339174 (diff)
parent140242b0d4aed1d595d6565d088d9567c456d6b4 (diff)
downloadvcxsrv-70a13fe295183aeea369adcb94f2d67e69fab387.tar.gz
vcxsrv-70a13fe295183aeea369adcb94f2d67e69fab387.tar.bz2
vcxsrv-70a13fe295183aeea369adcb94f2d67e69fab387.zip
svn merge ^/branches/released .
Diffstat (limited to 'mesalib/src/mesa/main')
-rw-r--r--mesalib/src/mesa/main/texgetimage.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/mesalib/src/mesa/main/texgetimage.c b/mesalib/src/mesa/main/texgetimage.c
index fe5ac0a89..0436f09e1 100644
--- a/mesalib/src/mesa/main/texgetimage.c
+++ b/mesalib/src/mesa/main/texgetimage.c
@@ -74,6 +74,7 @@ get_tex_color_index(struct gl_context *ctx, GLuint dimensions,
const GLint width = texImage->Width;
const GLint height = texImage->Height;
const GLint depth = texImage->Depth;
+ const GLint rowstride = texImage->RowStride;
const GLuint indexBits =
_mesa_get_format_bits(texImage->TexFormat, GL_TEXTURE_INDEX_SIZE_EXT);
const GLbitfield transferOps = 0x0;
@@ -89,14 +90,14 @@ get_tex_color_index(struct gl_context *ctx, GLuint dimensions,
if (indexBits == 8) {
const GLubyte *src = (const GLubyte *) texImage->Data;
- src += width * (img * texImage->Height + row);
+ src += rowstride * (img * height + row);
for (col = 0; col < width; col++) {
indexRow[col] = src[col];
}
}
else if (indexBits == 16) {
const GLushort *src = (const GLushort *) texImage->Data;
- src += width * (img * texImage->Height + row);
+ src += rowstride * (img * height + row);
for (col = 0; col < width; col++) {
indexRow[col] = src[col];
}
@@ -159,6 +160,7 @@ get_tex_depth_stencil(struct gl_context *ctx, GLuint dimensions,
const GLint width = texImage->Width;
const GLint height = texImage->Height;
const GLint depth = texImage->Depth;
+ const GLint rowstride = texImage->RowStride;
const GLuint *src = (const GLuint *) texImage->Data;
GLint img, row;
@@ -172,7 +174,7 @@ get_tex_depth_stencil(struct gl_context *ctx, GLuint dimensions,
_mesa_swap4((GLuint *) dest, width);
}
- src += width * row + width * height * img;
+ src += rowstride;
}
}
}