summaryrefslogtreecommitdiffstats
path: root/src/mesa/pipe/softpipe
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-10-18 15:14:50 -0600
committerBrian <[email protected]>2007-10-18 15:14:50 -0600
commit5d39f4f9fdba4cd3333a39af583a73b85eb6bb74 (patch)
treea1a8d5a413b8a72fc61436d9a80f969b5812e778 /src/mesa/pipe/softpipe
parent874b6b9960ee3778182cf331f6faf59d477eb214 (diff)
fix bug in copy_rect(), use temp vars in sp_region_copy() to aid debugging
Diffstat (limited to 'src/mesa/pipe/softpipe')
-rw-r--r--src/mesa/pipe/softpipe/sp_region.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/mesa/pipe/softpipe/sp_region.c b/src/mesa/pipe/softpipe/sp_region.c
index 982e081f603..0f4d2f05758 100644
--- a/src/mesa/pipe/softpipe/sp_region.c
+++ b/src/mesa/pipe/softpipe/sp_region.c
@@ -147,7 +147,7 @@ copy_rect(ubyte * dst,
dst += dst_x * cpp;
src += src_x * cpp;
dst += dst_y * dst_pitch;
- src += src_y * dst_pitch;
+ src += src_y * src_pitch;
width *= cpp;
if (width == dst_pitch && width == src_pitch)
@@ -197,15 +197,18 @@ sp_region_copy(struct pipe_context *pipe,
unsigned src_offset,
unsigned srcx, unsigned srcy, unsigned width, unsigned height)
{
+ ubyte *src_map, *dst_map;
assert( dst->cpp == src->cpp );
- copy_rect(pipe->region_map(pipe, dst) + dst_offset,
+ dst_map = pipe->region_map(pipe, dst);
+ src_map = pipe->region_map(pipe, src);
+ copy_rect(dst_map + dst_offset,
dst->cpp,
dst->pitch,
- dstx, dsty,
- width, height,
- pipe->region_map(pipe, src) + src_offset,
- src->pitch,
+ dstx, dsty,
+ width, height,
+ src_map + src_offset,
+ src->pitch,
srcx, srcy);
pipe->region_unmap(pipe, src);