get rid of xmesa_clear_buffers()

This commit is contained in:
Brian 2007-10-31 15:08:19 -06:00
parent 4411614fed
commit 017d08a5e0
3 changed files with 4 additions and 51 deletions

View file

@ -273,45 +273,6 @@ clear_nbit_ximage(GLcontext *ctx, struct xmesa_renderbuffer *xrb, GLuint value)
}
void
xmesa_clear_buffers(GLcontext *ctx, GLbitfield buffers, GLuint value)
{
if (ctx->DrawBuffer->Name == 0) {
/* this is a window system framebuffer */
const GLuint *colorMask = (GLuint *) &ctx->Color.ColorMask;
XMesaBuffer b = XMESA_BUFFER(ctx->DrawBuffer);
/* we can't handle color or index masking */
if (*colorMask == 0xffffffff && ctx->Color.IndexMask == 0xffffffff) {
if (buffers & BUFFER_BIT_FRONT_LEFT) {
/* clear front color buffer */
struct gl_renderbuffer *frontRb
= ctx->DrawBuffer->Attachment[BUFFER_FRONT_LEFT].Renderbuffer;
if (b->frontxrb == xmesa_renderbuffer(frontRb)) {
/* renderbuffer is not wrapped - great! */
b->frontxrb->clearFunc(ctx, b->frontxrb, value);
buffers &= ~BUFFER_BIT_FRONT_LEFT;
}
else {
/* we can't directly clear an alpha-wrapped color buffer */
}
}
if (buffers & BUFFER_BIT_BACK_LEFT) {
/* clear back color buffer */
struct gl_renderbuffer *backRb
= ctx->DrawBuffer->Attachment[BUFFER_BACK_LEFT].Renderbuffer;
if (b->backxrb == xmesa_renderbuffer(backRb)) {
/* renderbuffer is not wrapped - great! */
b->backxrb->clearFunc(ctx, b->backxrb, value);
buffers &= ~BUFFER_BIT_BACK_LEFT;
}
}
}
}
}
static void
clear_color_HPCR_ximage( GLcontext *ctx, const GLfloat color[4] )
{

View file

@ -214,6 +214,7 @@ xmesa_is_format_supported(struct pipe_context *pipe, uint format)
void
xmesa_clear(struct pipe_context *pipe, struct pipe_surface *ps, GLuint value)
{
GET_CURRENT_CONTEXT(ctx);
struct xmesa_renderbuffer *xrb = xmesa_rb(ps);
/* XXX actually, we should just discard any cached tiles from this
@ -233,15 +234,9 @@ xmesa_clear(struct pipe_context *pipe, struct pipe_surface *ps, GLuint value)
}
}
if (xrb && xrb->ximage) {
/* clearing back color buffer */
GET_CURRENT_CONTEXT(ctx);
xmesa_clear_buffers(ctx, BUFFER_BIT_BACK_LEFT, value);
}
else if (xrb && xrb->pixmap) {
/* clearing front color buffer */
GET_CURRENT_CONTEXT(ctx);
xmesa_clear_buffers(ctx, BUFFER_BIT_FRONT_LEFT, value);
if (xrb) {
/* clearing front/back color buffer */
xrb->clearFunc(ctx, xrb, value);
}
else {
/* clearing other buffer */

View file

@ -584,9 +584,6 @@ struct xmesa_surface
extern void
xmesa_clear(struct pipe_context *pipe, struct pipe_surface *ps, GLuint value);
extern void
xmesa_clear_buffers(GLcontext *ctx, GLbitfield buffers, GLuint value);
extern struct pipe_context *
xmesa_create_softpipe(XMesaContext xm);