diff options
author | Brian Paul <[email protected]> | 2012-03-11 18:31:32 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2012-03-12 11:40:43 -0600 |
commit | fdbb717b24438da7fa5ca7b48e3900ac02d841a1 (patch) | |
tree | dce0232889647c2dcc2971654eb39826a9c2d22c /src/mesa/drivers/x11/xm_dd.c | |
parent | c90ae6b501a4a72d33869e1be241e87264747735 (diff) |
xlib: remove clear_color() function
Just setup the clearing color in clear_buffers().
Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/mesa/drivers/x11/xm_dd.c')
-rw-r--r-- | src/mesa/drivers/x11/xm_dd.c | 36 |
1 files changed, 11 insertions, 25 deletions
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; |