st_cb_blit.c File Reference

Include dependency graph for st_cb_blit.c:

Go to the source code of this file.

Functions

void st_init_blit (struct st_context *st)
void st_destroy_blit (struct st_context *st)
static void st_BlitFramebuffer (GLcontext *ctx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
void st_init_blit_functions (struct dd_function_table *functions)


Function Documentation

static void st_BlitFramebuffer ( GLcontext *  ctx,
GLint  srcX0,
GLint  srcY0,
GLint  srcX1,
GLint  srcY1,
GLint  dstX0,
GLint  dstY0,
GLint  dstX1,
GLint  dstY1,
GLbitfield  mask,
GLenum  filter 
) [static]

Definition at line 67 of file st_cb_blit.c.

References st_renderbuffer::Base, st_context::blit, PIPE_TEX_MIPFILTER_LINEAR, PIPE_TEX_MIPFILTER_NEAREST, st_fb_orientation(), st_renderbuffer(), st_renderbuffer::surface, util_blit_pixels(), and Y_0_TOP.

00071 {
00072    struct st_context *st = ctx->st;
00073 
00074    const uint pFilter = ((filter == GL_NEAREST)
00075                          ? PIPE_TEX_MIPFILTER_NEAREST
00076                          : PIPE_TEX_MIPFILTER_LINEAR);
00077 
00078    if (mask & GL_COLOR_BUFFER_BIT) {
00079       struct st_renderbuffer *srcRb = 
00080          st_renderbuffer(ctx->ReadBuffer->_ColorReadBuffer);
00081       struct st_renderbuffer *dstRb = 
00082          st_renderbuffer(ctx->DrawBuffer->_ColorDrawBuffers[0][0]);
00083       struct pipe_surface *srcSurf = srcRb->surface;
00084       struct pipe_surface *dstSurf = dstRb->surface;
00085 
00086       if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP) {
00087          /* invert Y */
00088          srcY0 = srcRb->Base.Height - srcY0;
00089          srcY1 = srcRb->Base.Height - srcY1;
00090 
00091          dstY0 = dstRb->Base.Height - dstY0;
00092          dstY1 = dstRb->Base.Height - dstY1;
00093       }
00094 
00095       util_blit_pixels(st->blit,
00096                        srcSurf, srcX0, srcY0, srcX1, srcY1,
00097                        dstSurf, dstX0, dstY0, dstX1, dstY1,
00098                        0.0, pFilter);
00099 
00100    }
00101 }

void st_destroy_blit ( struct st_context st  ) 

Definition at line 59 of file st_cb_blit.c.

References st_context::blit, and util_destroy_blit().

00060 {
00061    util_destroy_blit(st->blit);
00062    st->blit = NULL;
00063 }

void st_init_blit ( struct st_context st  ) 

Definition at line 52 of file st_cb_blit.c.

References st_context::blit, st_context::cso_context, st_context::pipe, and util_create_blit().

00053 {
00054    st->blit = util_create_blit(st->pipe, st->cso_context);
00055 }

void st_init_blit_functions ( struct dd_function_table *  functions  ) 

Definition at line 106 of file st_cb_blit.c.

References st_BlitFramebuffer().

00107 {
00108 #if FEATURE_EXT_framebuffer_blit
00109    functions->BlitFramebuffer = st_BlitFramebuffer;
00110 #endif
00111 }


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