From: Brian Paul Date: Mon, 12 Mar 2012 00:31:32 +0000 (-0600) Subject: xlib: remove clear_color() function X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fdbb717b24438da7fa5ca7b48e3900ac02d841a1;p=mesa.git xlib: remove clear_color() function Just setup the clearing color in clear_buffers(). Reviewed-by: Dave Airlie --- diff --git a/src/mesa/drivers/x11/xm_dd.c b/src/mesa/drivers/x11/xm_dd.c index d0bf2f0b7d7..7748298d49f 100644 --- a/src/mesa/drivers/x11/xm_dd.c +++ b/src/mesa/drivers/x11/xm_dd.c @@ -59,30 +59,6 @@ finish_or_flush( struct gl_context *ctx ) } -static void -clear_color( struct gl_context *ctx, - const union gl_color_union color ) -{ - if (ctx->DrawBuffer->Name == 0) { - const XMesaContext xmesa = XMESA_CONTEXT(ctx); - XMesaBuffer xmbuf = XMESA_BUFFER(ctx->DrawBuffer); - - _mesa_unclamped_float_rgba_to_ubyte(xmesa->clearcolor, color.f); - xmesa->clearpixel = xmesa_color_to_pixel( ctx, - xmesa->clearcolor[0], - xmesa->clearcolor[1], - xmesa->clearcolor[2], - xmesa->clearcolor[3], - xmesa->xm_visual->undithered_pf ); - _glthread_LOCK_MUTEX(_xmesa_lock); - XMesaSetForeground( xmesa->display, xmbuf->cleargc, - xmesa->clearpixel ); - _glthread_UNLOCK_MUTEX(_xmesa_lock); - } -} - - - /* Implements glColorMask() */ static void color_mask(struct gl_context *ctx, @@ -267,12 +243,23 @@ clear_buffers(struct gl_context *ctx, GLbitfield buffers) if (ctx->DrawBuffer->Name == 0) { /* this is a window system framebuffer */ const GLuint *colorMask = (GLuint *) &ctx->Color.ColorMask[0]; + const XMesaContext xmesa = XMESA_CONTEXT(ctx); XMesaBuffer b = XMESA_BUFFER(ctx->DrawBuffer); const GLint x = ctx->DrawBuffer->_Xmin; const GLint y = ctx->DrawBuffer->_Ymin; const GLint width = ctx->DrawBuffer->_Xmax - x; const GLint height = ctx->DrawBuffer->_Ymax - y; + _mesa_unclamped_float_rgba_to_ubyte(xmesa->clearcolor, + ctx->Color.ClearColor.f); + xmesa->clearpixel = xmesa_color_to_pixel(ctx, + xmesa->clearcolor[0], + xmesa->clearcolor[1], + xmesa->clearcolor[2], + xmesa->clearcolor[3], + xmesa->xm_visual->undithered_pf); + XMesaSetForeground(xmesa->display, b->cleargc, xmesa->clearpixel); + /* we can't handle color or index masking */ if (*colorMask == 0xffffffff && ctx->Color.IndexMask == 0xffffffff) { if (buffers & BUFFER_BIT_FRONT_LEFT) { @@ -877,7 +864,6 @@ xmesa_init_driver_functions( XMesaVisual xmvisual, driver->GetBufferSize = NULL; /* OBSOLETE */ driver->Flush = finish_or_flush; driver->Finish = finish_or_flush; - driver->ClearColor = clear_color; driver->ColorMask = color_mask; driver->Enable = enable; driver->Viewport = xmesa_viewport;