i915_surface.c File Reference

Include dependency graph for i915_surface.c:

Go to the source code of this file.

Functions

static void i915_surface_copy (struct pipe_context *pipe, boolean do_flip, struct pipe_surface *dst, unsigned dstx, unsigned dsty, struct pipe_surface *src, unsigned srcx, unsigned srcy, unsigned width, unsigned height)
static void i915_surface_fill (struct pipe_context *pipe, struct pipe_surface *dst, unsigned dstx, unsigned dsty, unsigned width, unsigned height, unsigned value)
void i915_init_surface_functions (struct i915_context *i915)


Function Documentation

void i915_init_surface_functions ( struct i915_context i915  ) 

Definition at line 119 of file i915_surface.c.

References i915_surface_copy(), i915_surface_fill(), i915_context::pipe, pipe_context::surface_copy, and pipe_context::surface_fill.

00120 {
00121    i915->pipe.surface_copy = i915_surface_copy;
00122    i915->pipe.surface_fill = i915_surface_fill;
00123 }

static void i915_surface_copy ( struct pipe_context pipe,
boolean  do_flip,
struct pipe_surface dst,
unsigned  dstx,
unsigned  dsty,
struct pipe_surface src,
unsigned  srcx,
unsigned  srcy,
unsigned  width,
unsigned  height 
) [static]

Definition at line 43 of file i915_surface.c.

References assert, pipe_surface::block, pipe_surface::buffer, pipe_format_block::height, i915_context(), i915_copy_blit(), pipe_surface::offset, PIPE_BUFFER_USAGE_CPU_READ, PIPE_BUFFER_USAGE_CPU_WRITE, pipe_copy_rect(), pipe_context::screen, pipe_format_block::size, pipe_surface::stride, pipe_screen::surface_map, pipe_screen::surface_unmap, and pipe_format_block::width.

00049 {
00050    assert( dst != src );
00051    assert( dst->block.size == src->block.size );
00052    assert( dst->block.width == src->block.height );
00053    assert( dst->block.height == src->block.height );
00054 
00055    if (0) {
00056       void *dst_map = pipe->screen->surface_map( pipe->screen,
00057                                                  dst,
00058                                                  PIPE_BUFFER_USAGE_CPU_WRITE );
00059       
00060       const void *src_map = pipe->screen->surface_map( pipe->screen,
00061                                                        src,
00062                                                        PIPE_BUFFER_USAGE_CPU_READ );
00063       
00064       pipe_copy_rect(dst_map,
00065                      &dst->block,
00066                      dst->stride,
00067                      dstx, dsty,
00068                      width, height,
00069                      src_map,
00070                      do_flip ? -(int) src->stride : src->stride,
00071                      srcx, do_flip ? height - 1 - srcy : srcy);
00072 
00073       pipe->screen->surface_unmap(pipe->screen, src);
00074       pipe->screen->surface_unmap(pipe->screen, dst);
00075    }
00076    else {
00077       assert(dst->block.width == 1);
00078       assert(dst->block.height == 1);
00079       i915_copy_blit( i915_context(pipe),
00080                       do_flip,
00081                       dst->block.size,
00082                       (short) src->stride, src->buffer, src->offset,
00083                       (short) dst->stride, dst->buffer, dst->offset,
00084                       (short) srcx, (short) srcy, (short) dstx, (short) dsty, (short) width, (short) height );
00085    }
00086 }

static void i915_surface_fill ( struct pipe_context pipe,
struct pipe_surface dst,
unsigned  dstx,
unsigned  dsty,
unsigned  width,
unsigned  height,
unsigned  value 
) [static]

Definition at line 90 of file i915_surface.c.

References assert, pipe_surface::block, pipe_surface::buffer, pipe_format_block::height, i915_context(), i915_fill_blit(), pipe_surface::offset, PIPE_BUFFER_USAGE_CPU_WRITE, pipe_fill_rect(), pipe_context::screen, pipe_format_block::size, pipe_surface::stride, pipe_screen::surface_map, pipe_screen::surface_unmap, and pipe_format_block::width.

00094 {
00095    if (0) {
00096       void *dst_map = pipe->screen->surface_map( pipe->screen,
00097                                                  dst,
00098                                                  PIPE_BUFFER_USAGE_CPU_WRITE );
00099 
00100       pipe_fill_rect(dst_map, &dst->block, dst->stride, dstx, dsty, width, height, value);
00101 
00102       pipe->screen->surface_unmap(pipe->screen, dst);
00103    }
00104    else {
00105       assert(dst->block.width == 1);
00106       assert(dst->block.height == 1);
00107       i915_fill_blit( i915_context(pipe),
00108                       dst->block.size,
00109                       (short) dst->stride,
00110                       dst->buffer, dst->offset,
00111                       (short) dstx, (short) dsty,
00112                       (short) width, (short) height,
00113                       value );
00114    }
00115 }


Generated on Tue Sep 29 06:25:35 2009 for Gallium3D by  doxygen 1.5.4