diff options
author | Ben Skeggs <[email protected]> | 2008-05-27 00:59:41 +1000 |
---|---|---|
committer | Ben Skeggs <[email protected]> | 2008-05-27 00:59:41 +1000 |
commit | 0f9635d9d522ea712724415599ceb44d53e67819 (patch) | |
tree | 91484d00053baeb265d04a54a116229562194217 /src/gallium/drivers/softpipe/sp_surface.c | |
parent | 8f67f98959261d193cb5f3db274b55fb24e2bb1e (diff) | |
parent | 253066d716e3039522eeb7b072811cccd89b4a82 (diff) |
Merge remote branch 'upstream/gallium-0.1' into nouveau-gallium-0.1
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_surface.c')
-rw-r--r-- | src/gallium/drivers/softpipe/sp_surface.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/gallium/drivers/softpipe/sp_surface.c b/src/gallium/drivers/softpipe/sp_surface.c index 653449c4f18..29a1e92416e 100644 --- a/src/gallium/drivers/softpipe/sp_surface.c +++ b/src/gallium/drivers/softpipe/sp_surface.c @@ -46,19 +46,28 @@ sp_surface_copy(struct pipe_context *pipe, struct pipe_surface *src, unsigned srcx, unsigned srcy, unsigned width, unsigned height) { + void *dst_map = pipe->screen->surface_map( pipe->screen, + dst, + PIPE_BUFFER_USAGE_CPU_WRITE ); + + const void *src_map = pipe->screen->surface_map( pipe->screen, + src, + PIPE_BUFFER_USAGE_CPU_READ ); + assert( dst->cpp == src->cpp ); + assert(src_map && dst_map); - pipe_copy_rect(pipe_surface_map(dst), + pipe_copy_rect(dst_map, dst->cpp, dst->pitch, dstx, dsty, width, height, - pipe_surface_map(src), + src_map, do_flip ? -(int) src->pitch : src->pitch, srcx, do_flip ? 1 - srcy - height : srcy); - pipe_surface_unmap(src); - pipe_surface_unmap(dst); + pipe->screen->surface_unmap(pipe->screen, src); + pipe->screen->surface_unmap(pipe->screen, dst); } @@ -83,7 +92,9 @@ sp_surface_fill(struct pipe_context *pipe, unsigned width, unsigned height, unsigned value) { unsigned i, j; - void *dst_map = pipe_surface_map(dst); + void *dst_map = pipe->screen->surface_map( pipe->screen, + dst, + PIPE_BUFFER_USAGE_CPU_WRITE ); assert(dst->pitch > 0); assert(width <= dst->pitch); @@ -147,7 +158,7 @@ sp_surface_fill(struct pipe_context *pipe, break; } - pipe_surface_unmap( dst ); + pipe->screen->surface_unmap(pipe->screen, dst); } |