/* This is needed to support 1.1's RGB logic ops AND
* 1.0's blending logicops.
*/
- ctx->Color.ColorLogicOpEnabled = (mode==GL_LOGIC_OP &&
- ctx->Color.BlendEnabled);
+ ctx->Color._LogicOpEnabled = (ctx->Color.ColorLogicOpEnabled ||
+ (ctx->Color.BlendEnabled &&
+ mode == GL_LOGIC_OP));
if (ctx->Driver.BlendEquation)
(*ctx->Driver.BlendEquation)( ctx, mode );
ASSIGN_4V( ctx->Color.BlendColor, 0.0, 0.0, 0.0, 0.0 );
ctx->Color.IndexLogicOpEnabled = GL_FALSE;
ctx->Color.ColorLogicOpEnabled = GL_FALSE;
+ ctx->Color._LogicOpEnabled = GL_FALSE;
ctx->Color.LogicOp = GL_COPY;
ctx->Color.DitherFlag = GL_TRUE;
return;
FLUSH_VERTICES(ctx, _NEW_COLOR);
ctx->Color.BlendEnabled = state;
- /* The following needed to accomodate 1.0 RGB logic op blending */
- ctx->Color.ColorLogicOpEnabled =
- (ctx->Color.BlendEquation == GL_LOGIC_OP && state);
+ /* This is needed to support 1.1's RGB logic ops AND
+ * 1.0's blending logicops.
+ */
+ ctx->Color._LogicOpEnabled =
+ (ctx->Color.ColorLogicOpEnabled ||
+ (state && ctx->Color.BlendEquation == GL_LOGIC_OP));
break;
#if FEATURE_userclip
case GL_CLIP_PLANE0:
return;
FLUSH_VERTICES(ctx, _NEW_COLOR);
ctx->Color.ColorLogicOpEnabled = state;
+ /* This is needed to support 1.1's RGB logic ops AND
+ * 1.0's blending logicops.
+ */
+ ctx->Color._LogicOpEnabled =
+ (state || (ctx->Color.BlendEnabled &&
+ ctx->Color.BlendEquation == GL_LOGIC_OP));
break;
case GL_MAP1_COLOR_4:
if (ctx->Eval.Map1Color4 == state)
GLenum LogicOp; /**< Logic operator */
GLboolean IndexLogicOpEnabled; /**< Color index logic op enabled flag */
GLboolean ColorLogicOpEnabled; /**< RGBA logic op enabled flag */
+ GLboolean _LogicOpEnabled; /**< RGBA logic op + EXT_blend_logic_op enabled flag */
/*@}*/
GLboolean DitherFlag; /**< Dither enable flag */
ASSERT(span->end <= MAX_WIDTH);
ASSERT(span->arrayMask & SPAN_RGBA);
- ASSERT(!ctx->Color.ColorLogicOpEnabled);
+ ASSERT(!ctx->Color._LogicOpEnabled);
/* Read span of current frame buffer pixels */
if (span->arrayMask & SPAN_XY) {
if (ctx->Visual.rgbMode) {
const GLuint colorMask = *((GLuint *) &ctx->Color.ColorMask);
if (colorMask != 0xffffffff) RasterMask |= MASKING_BIT;
- if (ctx->Color.ColorLogicOpEnabled) RasterMask |= LOGIC_OP_BIT;
+ if (ctx->Color._LogicOpEnabled) RasterMask |= LOGIC_OP_BIT;
if (ctx->Texture._EnabledUnits) RasterMask |= TEXTURE_BIT;
}
else {
/* make copy of incoming colors */
MEMCPY( rgbaTmp, span->array->rgba, 4 * span->end * sizeof(GLchan) );
- if (ctx->Color.ColorLogicOpEnabled) {
+ if (ctx->Color._LogicOpEnabled) {
_swrast_logicop_rgba_span(ctx, span, rgbaTmp);
}
else if (ctx->Color.BlendEnabled) {
}
else {
/* normal: write to exactly one buffer */
- if (ctx->Color.ColorLogicOpEnabled) {
+ if (ctx->Color._LogicOpEnabled) {
_swrast_logicop_rgba_span(ctx, span, span->array->rgba);
monoColor = GL_FALSE;
}
}
else {
/* normal: write to exactly one buffer */
- if (ctx->Color.ColorLogicOpEnabled) {
+ if (ctx->Color._LogicOpEnabled) {
_swrast_logicop_rgba_span(ctx, span, span->array->rgba);
}
else if (ctx->Color.BlendEnabled) {