summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/x11/xm_dd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/x11/xm_dd.c')
-rw-r--r--src/mesa/drivers/x11/xm_dd.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/mesa/drivers/x11/xm_dd.c b/src/mesa/drivers/x11/xm_dd.c
index 57254148561..0aa47d55e46 100644
--- a/src/mesa/drivers/x11/xm_dd.c
+++ b/src/mesa/drivers/x11/xm_dd.c
@@ -435,6 +435,32 @@ clear_buffers(GLcontext *ctx, GLbitfield buffers)
}
+void
+xmesa_clear(struct pipe_context *pipe, GLboolean color, GLboolean depth,
+ GLboolean stencil, GLboolean accum)
+{
+ struct softpipe_context *sp = (struct softpipe_context *) pipe;
+ if (color) {
+ GET_CURRENT_CONTEXT(ctx);
+ GLuint i;
+ softpipe_update_derived(sp);
+ for (i = 0; i < sp->framebuffer.num_cbufs; i++) {
+ struct pipe_surface *ps = sp->framebuffer.cbufs[i];
+ struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) ps->rb;
+ const GLint x = sp->cliprect.minx;
+ const GLint y = sp->cliprect.miny;
+ const GLint w = sp->cliprect.maxx - x;
+ const GLint h = sp->cliprect.maxy - y;
+ xrb->clearFunc(ctx, xrb, x, y, w, h);
+ }
+ color = GL_FALSE;
+ }
+
+ softpipe_clear(pipe, color, depth, stencil, accum);
+}
+
+
+
#ifndef XFree86Server
/* XXX this was never tested in the Xserver environment */