diff options
author | Brian <[email protected]> | 2007-08-02 16:08:18 -0600 |
---|---|---|
committer | Brian <[email protected]> | 2007-08-02 16:08:18 -0600 |
commit | 47fdaf0ed9ef2f89cdaa97d0d48b1f1194d710c6 (patch) | |
tree | 3e4be03579b8bc860dc29e4c7b2ae93fded4e759 /src/mesa/drivers/x11 | |
parent | 184b6a1f04e060e73858438561a0261d32eeb506 (diff) |
pipe->clear() now takes a surface, rather than color/depth/stencil flags.
pipe->clear() only used to clear whole buffers (no scissor) w/out masking.
Draw a colored quadrilateral in all other cases.
Diffstat (limited to 'src/mesa/drivers/x11')
-rw-r--r-- | src/mesa/drivers/x11/xm_api.c | 5 | ||||
-rw-r--r-- | src/mesa/drivers/x11/xm_dd.c | 23 | ||||
-rw-r--r-- | src/mesa/drivers/x11/xmesaP.h | 7 |
3 files changed, 19 insertions, 16 deletions
diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index 92d37085d1a..7fb99df5f4c 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -1573,8 +1573,11 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) st_create_context( mesaCtx, softpipe_create() ); + mesaCtx->Driver.Clear = xmesa_clear_buffers; + /* mesaCtx->st->pipe->clear = xmesa_clear; - + */ + return c; } diff --git a/src/mesa/drivers/x11/xm_dd.c b/src/mesa/drivers/x11/xm_dd.c index 87f8ede50b3..f64f8780cf6 100644 --- a/src/mesa/drivers/x11/xm_dd.c +++ b/src/mesa/drivers/x11/xm_dd.c @@ -381,8 +381,8 @@ clear_nbit_ximage(GLcontext *ctx, struct xmesa_renderbuffer *xrb, -static void -clear_buffers(GLcontext *ctx, GLbitfield buffers) +void +xmesa_clear_buffers(GLcontext *ctx, GLbitfield buffers) { if (ctx->DrawBuffer->Name == 0) { /* this is a window system framebuffer */ @@ -395,7 +395,6 @@ clear_buffers(GLcontext *ctx, GLbitfield buffers) /* we can't handle color or index masking */ if (*colorMask == 0xffffffff && ctx->Color.IndexMask == 0xffffffff) { -#if 0 if (buffers & BUFFER_BIT_FRONT_LEFT) { /* clear front color buffer */ struct gl_renderbuffer *frontRb @@ -419,14 +418,6 @@ clear_buffers(GLcontext *ctx, GLbitfield buffers) buffers &= ~BUFFER_BIT_BACK_LEFT; } } -#else - /* Clear with state-tracker/pipe interface */ - struct st_context *st = st_context(ctx); - GLboolean color = (buffers & (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT)) ? 1: 0; - GLboolean depth = (buffers & BUFFER_BIT_DEPTH) ? 1 : 0; - GLboolean stencil = (buffers & BUFFER_BIT_STENCIL) ? 1 : 0; - st_clear(st, color, depth, stencil); -#endif } } if (buffers) @@ -434,6 +425,7 @@ clear_buffers(GLcontext *ctx, GLbitfield buffers) } +#if 0 void xmesa_clear(struct pipe_context *pipe, GLboolean color, GLboolean depth, GLboolean stencil, GLboolean accum) @@ -458,9 +450,14 @@ xmesa_clear(struct pipe_context *pipe, GLboolean color, GLboolean depth, xrb->clearFunc(ctx, xrb, x, y, w, h); } } - } +#endif + +void +xmesa_clear(struct pipe_context *pipe, struct pipe_surface *ps, GLuint value) +{ +} #ifndef XFree86Server @@ -1113,7 +1110,7 @@ xmesa_init_driver_functions( XMesaVisual xmvisual, driver->IndexMask = index_mask; driver->ColorMask = color_mask; driver->Enable = enable; - driver->Clear = clear_buffers; + driver->Clear = xmesa_clear_buffers; driver->Viewport = xmesa_viewport; #ifndef XFree86Server driver->CopyPixels = xmesa_CopyPixels; diff --git a/src/mesa/drivers/x11/xmesaP.h b/src/mesa/drivers/x11/xmesaP.h index fb1c1f8c3b4..dd95aed4d06 100644 --- a/src/mesa/drivers/x11/xmesaP.h +++ b/src/mesa/drivers/x11/xmesaP.h @@ -593,7 +593,10 @@ extern struct pipe_surface * xmesa_new_surface(GLcontext *ctx, struct xmesa_renderbuffer *xrb); extern void -xmesa_clear(struct pipe_context *pipe, GLboolean color, GLboolean depth, - GLboolean stencil, GLboolean accum); +xmesa_clear(struct pipe_context *pipe, struct pipe_surface *ps, GLuint value); + +extern void +xmesa_clear_buffers(GLcontext *ctx, GLbitfield buffers); + #endif |