summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2017-06-28 13:40:09 +1000
committerTimothy Arceri <[email protected]>2017-06-29 08:54:10 +1000
commitccbcb3ca17d68358f1c75a9440e4062785723f90 (patch)
tree495d0cf30397f614517f5f9824009556a46e612f /src/mesa
parent774580c8b9ae6a2def64f63163c71179fd55a624 (diff)
mesa: add logic_op() helper
Reviewed-by: Samuel Pitoiset <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/blend.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c
index 881e9c8a79f..541c24852d5 100644
--- a/src/mesa/main/blend.c
+++ b/src/mesa/main/blend.c
@@ -755,6 +755,21 @@ _mesa_AlphaFunc( GLenum func, GLclampf ref )
}
+static void
+logic_op(struct gl_context *ctx, GLenum opcode)
+{
+ if (ctx->Color.LogicOp == opcode)
+ return;
+
+ FLUSH_VERTICES(ctx, ctx->DriverFlags.NewLogicOp ? 0 : _NEW_COLOR);
+ ctx->NewDriverState |= ctx->DriverFlags.NewLogicOp;
+ ctx->Color.LogicOp = opcode;
+
+ if (ctx->Driver.LogicOpcode)
+ ctx->Driver.LogicOpcode(ctx, opcode);
+}
+
+
/**
* Specify a logic pixel operation for color index rendering.
*
@@ -796,15 +811,7 @@ _mesa_LogicOp( GLenum opcode )
return;
}
- if (ctx->Color.LogicOp == opcode)
- return;
-
- FLUSH_VERTICES(ctx, ctx->DriverFlags.NewLogicOp ? 0 : _NEW_COLOR);
- ctx->NewDriverState |= ctx->DriverFlags.NewLogicOp;
- ctx->Color.LogicOp = opcode;
-
- if (ctx->Driver.LogicOpcode)
- ctx->Driver.LogicOpcode( ctx, opcode );
+ logic_op(ctx, opcode);
}