summaryrefslogtreecommitdiff
path: root/src/mesa/main/state.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2006-07-18 19:15:40 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2006-07-18 19:15:40 +0000
commit813e56db511e783fcf1ad7bcfd40645451802bd7 (patch)
tree8d0bfd6572239b29fb3fe53be71ec923600ed652 /src/mesa/main/state.c
parentf81b1dbe374fe446f6ef676e70a72952ffb47d4e (diff)
Compute ctx->Color._LogicOpEnabled in one place instead of four places!
Diffstat (limited to 'src/mesa/main/state.c')
-rw-r--r--src/mesa/main/state.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index 56b835f537..784757e91f 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.1
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
@@ -985,6 +985,20 @@ update_viewport_matrix(GLcontext *ctx)
}
+/**
+ * Update derived color/blend/logicop state.
+ */
+static void
+update_color(GLcontext *ctx)
+{
+ /* This is needed to support 1.1's RGB logic ops AND
+ * 1.0's blending logicops.
+ */
+ ctx->Color._LogicOpEnabled = (ctx->Color.ColorLogicOpEnabled ||
+ (ctx->Color.BlendEnabled &&
+ ctx->Color.BlendEquationRGB == GL_LOGIC_OP));
+}
+
/**
* If __GLcontextRec::NewState is non-zero then this function \b must be called
@@ -1046,6 +1060,9 @@ _mesa_update_state( GLcontext *ctx )
if (new_state & (_NEW_BUFFERS | _NEW_VIEWPORT))
update_viewport_matrix(ctx);
+ if (new_state & _NEW_COLOR)
+ update_color( ctx );
+
if (ctx->_MaintainTexEnvProgram) {
if (new_state & (_NEW_TEXTURE | _DD_NEW_SEPARATE_SPECULAR | _NEW_FOG))
_mesa_UpdateTexEnvProgram(ctx);