brw_surface.c File Reference

Include dependency graph for brw_surface.c:

Go to the source code of this file.

Functions

static void brw_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 brw_surface_fill (struct pipe_context *pipe, struct pipe_surface *dst, unsigned dstx, unsigned dsty, unsigned width, unsigned height, unsigned value)
void brw_init_surface_functions (struct brw_context *brw)


Function Documentation

void brw_init_surface_functions ( struct brw_context brw  ) 

Definition at line 120 of file brw_surface.c.

References brw_surface_copy(), brw_surface_fill(), brw_context::pipe, pipe_context::surface_copy, and pipe_context::surface_fill.

00121 {
00122    brw->pipe.surface_copy  = brw_surface_copy;
00123    brw->pipe.surface_fill  = brw_surface_fill;
00124 }

static void brw_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 brw_surface.c.

References assert, pipe_surface::block, brw_context(), brw_copy_blit(), pipe_surface::buffer, FALSE, pipe_format_block::height, pipe_surface::offset, PIPE_BUFFER_USAGE_CPU_READ, PIPE_BUFFER_USAGE_CPU_WRITE, pipe_copy_rect(), PIPE_LOGICOP_COPY, 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       brw_copy_blit(brw_context(pipe),
00080                     do_flip,
00081                     dst->block.size,
00082                     (short) src->stride/src->block.size, src->buffer, src->offset, FALSE,
00083                     (short) dst->stride/dst->block.size, dst->buffer, dst->offset, FALSE,
00084                     (short) srcx, (short) srcy, (short) dstx, (short) dsty,
00085                     (short) width, (short) height, PIPE_LOGICOP_COPY);
00086    }
00087 }

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

Definition at line 91 of file brw_surface.c.

References assert, pipe_surface::block, brw_context(), brw_fill_blit(), pipe_surface::buffer, FALSE, pipe_format_block::height, 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.

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


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