diff options
author | Brian Paul <[email protected]> | 2005-04-18 17:48:25 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2005-04-18 17:48:25 +0000 |
commit | f905145b6087fca66368bfff5c62788a626f1298 (patch) | |
tree | f5b5d6d739afeb8bc6d23404eb23e801b53a15f3 | |
parent | 02986cb2cc1b1d47b26a653e9ae0fa508365f616 (diff) |
comments and clean-up
-rw-r--r-- | src/mesa/drivers/x11/xm_dd.c | 52 |
1 files changed, 27 insertions, 25 deletions
diff --git a/src/mesa/drivers/x11/xm_dd.c b/src/mesa/drivers/x11/xm_dd.c index 4afc81484a0..0588694ace8 100644 --- a/src/mesa/drivers/x11/xm_dd.c +++ b/src/mesa/drivers/x11/xm_dd.c @@ -142,9 +142,12 @@ finish_or_flush( GLcontext *ctx ) -/* +/** * This chooses the color buffer for reading and writing spans, points, * lines, and triangles. + * Remember that a GLframebuffer has several distinct color buffers: + * front/left, front/right, back/left, back/right and aux buffers. + * The bufferBit specifies which one to use. */ void xmesa_set_buffer( GLcontext *ctx, GLframebuffer *buffer, GLuint bufferBit ) @@ -1101,7 +1104,7 @@ void xmesa_update_state( GLcontext *ctx, GLuint new_state ) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); - /* Propogate statechange information to swrast and swrast_setup + /* Propagate statechange information to swrast and swrast_setup * modules. The X11 driver has no internal GL-dependent state. */ _swrast_InvalidateState( ctx, new_state ); @@ -1115,30 +1118,29 @@ void xmesa_update_state( GLcontext *ctx, GLuint new_state ) if (xmesa->xm_draw_buffer->backpixmap != XIMAGE) { xmesa->xm_draw_buffer->back_clear_func = clear_back_pixmap; } - else if (sizeof(GLushort)!=2 || sizeof(GLuint)!=4) { - xmesa->xm_draw_buffer->back_clear_func = clear_nbit_ximage; - } - else switch (xmesa->xm_visual->BitsPerPixel) { - case 8: - if (xmesa->xm_visual->hpcr_clear_flag) { - xmesa->xm_draw_buffer->back_clear_func = clear_HPCR_ximage; - } - else { - xmesa->xm_draw_buffer->back_clear_func = clear_8bit_ximage; + else { + switch (xmesa->xm_visual->BitsPerPixel) { + case 8: + if (xmesa->xm_visual->hpcr_clear_flag) { + xmesa->xm_draw_buffer->back_clear_func = clear_HPCR_ximage; + } + else { + xmesa->xm_draw_buffer->back_clear_func = clear_8bit_ximage; + } + break; + case 16: + xmesa->xm_draw_buffer->back_clear_func = clear_16bit_ximage; + break; + case 24: + xmesa->xm_draw_buffer->back_clear_func = clear_24bit_ximage; + break; + case 32: + xmesa->xm_draw_buffer->back_clear_func = clear_32bit_ximage; + break; + default: + xmesa->xm_draw_buffer->back_clear_func = clear_nbit_ximage; + break; } - break; - case 16: - xmesa->xm_draw_buffer->back_clear_func = clear_16bit_ximage; - break; - case 24: - xmesa->xm_draw_buffer->back_clear_func = clear_24bit_ximage; - break; - case 32: - xmesa->xm_draw_buffer->back_clear_func = clear_32bit_ximage; - break; - default: - xmesa->xm_draw_buffer->back_clear_func = clear_nbit_ximage; - break; } if (ctx->Color._DrawDestMask[0] & (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT)) { |