summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-10-29 11:04:11 -0600
committerBrian Paul <[email protected]>2009-10-29 11:04:24 -0600
commitea414e331802e49d59eb2ddd2466d58a383bc931 (patch)
tree75870a8aed59bc08692ec9e19a82162e76159638 /src/mesa
parent92e7c6a2581b5f612a84587500399bb00318c6f0 (diff)
intel: check for single memcpy() in memcpy_get_tex_image()
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex_image.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c
index c861fc552f2..6301444c340 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_image.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_image.c
@@ -696,11 +696,16 @@ memcpy_get_tex_image(GLcontext *ctx, GLenum target, GLint level,
const GLint srcRowStride = texImage->RowStride * bpp;
GLuint row;
- for (row = 0; row < texImage->Height; row++) {
- memcpy(dst, src, bytesPerRow);
- dst += dstRowStride;
- src += srcRowStride;
- }
+ if (bytesPerRow == dstRowStride && bytesPerRow == dstRowStride) {
+ memcpy(dst, src, bytesPerRow * texImage->Height);
+ }
+ else {
+ for (row = 0; row < texImage->Height; row++) {
+ memcpy(dst, src, bytesPerRow);
+ dst += dstRowStride;
+ src += srcRowStride;
+ }
+ }
}
if (_mesa_is_bufferobj(pack->BufferObj)) {