Mesa (master): mesa: add logic_op() helper

Timothy Arceri tarceri at kemper.freedesktop.org
Wed Jun 28 22:54:33 UTC 2017


Module: Mesa
Branch: master
Commit: ccbcb3ca17d68358f1c75a9440e4062785723f90
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ccbcb3ca17d68358f1c75a9440e4062785723f90

Author: Timothy Arceri <tarceri at itsqueeze.com>
Date:   Wed Jun 28 13:40:09 2017 +1000

mesa: add logic_op() helper

Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>

---

 src/mesa/main/blend.c | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c
index 881e9c8a79..541c24852d 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);
 }
 
 




More information about the mesa-commit mailing list