diff options
author | Michel Dänzer <[email protected]> | 2009-02-18 13:14:02 +0100 |
---|---|---|
committer | Michel Dänzer <[email protected]> | 2009-02-18 13:14:02 +0100 |
commit | b89aa1d87ad6cebdbb3f2067863c600f50bf0ff1 (patch) | |
tree | d131e28eaad0eb633eff0e1cd861595f8bc5f3c3 /src/gallium/drivers/i915simple/i915_surface.c | |
parent | 3da38db5949f4c73ec01282ebf9138a0510abbee (diff) |
i915simple: Minimal fixup for introduction of struct pipe_transfer.
Diffstat (limited to 'src/gallium/drivers/i915simple/i915_surface.c')
-rw-r--r-- | src/gallium/drivers/i915simple/i915_surface.c | 79 |
1 files changed, 24 insertions, 55 deletions
diff --git a/src/gallium/drivers/i915simple/i915_surface.c b/src/gallium/drivers/i915simple/i915_surface.c index 94e2deaf615..7eec649906c 100644 --- a/src/gallium/drivers/i915simple/i915_surface.c +++ b/src/gallium/drivers/i915simple/i915_surface.c @@ -47,44 +47,22 @@ i915_surface_copy(struct pipe_context *pipe, struct pipe_surface *src, unsigned srcx, unsigned srcy, unsigned width, unsigned height) { - assert( dst != src ); - assert( dst->block.size == src->block.size ); - assert( dst->block.width == src->block.height ); - assert( dst->block.height == src->block.height ); + struct i915_texture *dst_tex = (struct i915_texture *)dst->texture; + struct i915_texture *src_tex = (struct i915_texture *)src->texture; - if (0) { - 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 ); - - pipe_copy_rect(dst_map, - &dst->block, - dst->stride, - dstx, dsty, - width, height, - src_map, - do_flip ? -(int) src->stride : src->stride, - srcx, do_flip ? height - 1 - srcy : srcy); + assert( dst != src ); + assert( dst_tex->base.block.size == src_tex->base.block.size ); + assert( dst_tex->base.block.width == src_tex->base.block.height ); + assert( dst_tex->base.block.height == src_tex->base.block.height ); + assert( dst_tex->base.block.width == 1 ); + assert( dst_tex->base.block.height == 1 ); - pipe->screen->surface_unmap(pipe->screen, src); - pipe->screen->surface_unmap(pipe->screen, dst); - } - else { - struct i915_texture *dst_tex = (struct i915_texture *)dst->texture; - struct i915_texture *src_tex = (struct i915_texture *)src->texture; - assert(dst->block.width == 1); - assert(dst->block.height == 1); - i915_copy_blit( i915_context(pipe), - do_flip, - dst->block.size, - (unsigned short) src->stride, src_tex->buffer, src->offset, - (unsigned short) dst->stride, dst_tex->buffer, dst->offset, - (short) srcx, (short) srcy, (short) dstx, (short) dsty, (short) width, (short) height ); - } + i915_copy_blit( i915_context(pipe), + do_flip, + dst_tex->base.block.size, + (unsigned short) src_tex->stride, src_tex->buffer, src->offset, + (unsigned short) dst_tex->stride, dst_tex->buffer, dst->offset, + (short) srcx, (short) srcy, (short) dstx, (short) dsty, (short) width, (short) height ); } @@ -94,27 +72,18 @@ i915_surface_fill(struct pipe_context *pipe, unsigned dstx, unsigned dsty, unsigned width, unsigned height, unsigned value) { - if (0) { - void *dst_map = pipe->screen->surface_map( pipe->screen, - dst, - PIPE_BUFFER_USAGE_CPU_WRITE ); + struct i915_texture *tex = (struct i915_texture *)dst->texture; - pipe_fill_rect(dst_map, &dst->block, dst->stride, dstx, dsty, width, height, value); + assert(tex->base.block.width == 1); + assert(tex->base.block.height == 1); - pipe->screen->surface_unmap(pipe->screen, dst); - } - else { - struct i915_texture *tex = (struct i915_texture *)dst->texture; - assert(dst->block.width == 1); - assert(dst->block.height == 1); - i915_fill_blit( i915_context(pipe), - dst->block.size, - (unsigned short) dst->stride, - tex->buffer, dst->offset, - (short) dstx, (short) dsty, - (short) width, (short) height, - value ); - } + i915_fill_blit( i915_context(pipe), + tex->base.block.size, + (unsigned short) tex->stride, + tex->buffer, dst->offset, + (short) dstx, (short) dsty, + (short) width, (short) height, + value ); } |