/**
- * Called when the driver should update it's state, based on the new_state
+ * Called when the driver should update its state, based on the new_state
* flags.
*/
void
-xmesa_update_state( GLcontext *ctx, GLuint new_state )
+xmesa_update_state( GLcontext *ctx, GLbitfield new_state )
{
const XMesaContext xmesa = XMESA_CONTEXT(ctx);
- struct xmesa_renderbuffer *front_xrb, *back_xrb;
/* Propagate statechange information to swrast and swrast_setup
* modules. The X11 driver has no internal GL-dependent state.
if (ctx->DrawBuffer->Name != 0)
return;
- front_xrb = XMESA_BUFFER(ctx->DrawBuffer)->frontxrb;
- if (front_xrb) {
- /* XXX check for relevant new_state flags */
- xmesa_set_renderbuffer_funcs(front_xrb, xmesa->pixelformat,
- xmesa->xm_visual->BitsPerPixel);
- /* setup pointers to front and back buffer clear functions */
- front_xrb->clearFunc = clear_pixmap;
- }
+ /*
+ * GL_DITHER and GL_READ/DRAW_BUFFER state effect renderbuffer funcs
+ */
+ if (new_state & (_NEW_COLOR | _NEW_PIXEL)) {
+ struct xmesa_renderbuffer *front_xrb, *back_xrb;
+
+ front_xrb = XMESA_BUFFER(ctx->DrawBuffer)->frontxrb;
+ if (front_xrb) {
+ /* XXX check for relevant new_state flags */
+ xmesa_set_renderbuffer_funcs(front_xrb, xmesa->pixelformat,
+ xmesa->xm_visual->BitsPerPixel);
+ /* setup pointers to front and back buffer clear functions */
+ front_xrb->clearFunc = clear_pixmap;
+ }
- back_xrb = XMESA_BUFFER(ctx->DrawBuffer)->backxrb;
- if (back_xrb) {
- XMesaBuffer xmbuf = XMESA_BUFFER(ctx->DrawBuffer);
+ back_xrb = XMESA_BUFFER(ctx->DrawBuffer)->backxrb;
+ if (back_xrb) {
+ XMesaBuffer xmbuf = XMESA_BUFFER(ctx->DrawBuffer);
- /* XXX check for relevant new_state flags */
- xmesa_set_renderbuffer_funcs(back_xrb, xmesa->pixelformat,
- xmesa->xm_visual->BitsPerPixel);
+ /* XXX check for relevant new_state flags */
+ xmesa_set_renderbuffer_funcs(back_xrb, xmesa->pixelformat,
+ xmesa->xm_visual->BitsPerPixel);
- if (xmbuf->backxrb->pixmap) {
- back_xrb->clearFunc = clear_pixmap;
- }
- else {
- switch (xmesa->xm_visual->BitsPerPixel) {
- case 8:
- if (xmesa->xm_visual->hpcr_clear_flag) {
- back_xrb->clearFunc = clear_HPCR_ximage;
- }
- else {
- back_xrb->clearFunc = clear_8bit_ximage;
+ if (xmbuf->backxrb->pixmap) {
+ back_xrb->clearFunc = clear_pixmap;
+ }
+ else {
+ switch (xmesa->xm_visual->BitsPerPixel) {
+ case 8:
+ if (xmesa->xm_visual->hpcr_clear_flag) {
+ back_xrb->clearFunc = clear_HPCR_ximage;
+ }
+ else {
+ back_xrb->clearFunc = clear_8bit_ximage;
+ }
+ break;
+ case 16:
+ back_xrb->clearFunc = clear_16bit_ximage;
+ break;
+ case 24:
+ back_xrb->clearFunc = clear_24bit_ximage;
+ break;
+ case 32:
+ back_xrb->clearFunc = clear_32bit_ximage;
+ break;
+ default:
+ back_xrb->clearFunc = clear_nbit_ximage;
+ break;
}
- break;
- case 16:
- back_xrb->clearFunc = clear_16bit_ximage;
- break;
- case 24:
- back_xrb->clearFunc = clear_24bit_ximage;
- break;
- case 32:
- back_xrb->clearFunc = clear_32bit_ximage;
- break;
- default:
- back_xrb->clearFunc = clear_nbit_ximage;
- break;
}
}
}
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
extern void xmesa_init_driver_functions( XMesaVisual xmvisual,
struct dd_function_table *driver );
-extern void xmesa_update_state( GLcontext *ctx, GLuint new_state );
+extern void xmesa_update_state( GLcontext *ctx, GLbitfield new_state );
extern void
xmesa_set_renderbuffer_funcs(struct xmesa_renderbuffer *xrb,