[Mesa-dev] [PATCH 005/101] mesa: add blend_equationi() helper

Samuel Pitoiset samuel.pitoiset at gmail.com
Fri Jul 21 17:39:14 UTC 2017


Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 src/mesa/main/blend.c | 29 ++++++++++++++++++-----------
 1 file changed, 18 insertions(+), 11 deletions(-)

diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c
index 3265628311..84029ac6be 100644
--- a/src/mesa/main/blend.c
+++ b/src/mesa/main/blend.c
@@ -552,6 +552,23 @@ _mesa_BlendEquation( GLenum mode )
 /**
  * Set blend equation for one color buffer/target.
  */
+static void
+blend_equationi(struct gl_context *ctx, GLuint buf, GLenum mode,
+                enum gl_advanced_blend_mode advanced_mode)
+{
+   if (ctx->Color.Blend[buf].EquationRGB == mode &&
+       ctx->Color.Blend[buf].EquationA == mode)
+      return;  /* no change */
+
+   _mesa_flush_vertices_for_blend_state(ctx);
+   ctx->Color.Blend[buf].EquationRGB = mode;
+   ctx->Color.Blend[buf].EquationA = mode;
+   ctx->Color._BlendEquationPerBuffer = GL_TRUE;
+
+   if (buf == 0)
+      ctx->Color._AdvancedBlendMode = advanced_mode;
+}
+
 void GLAPIENTRY
 _mesa_BlendEquationiARB(GLuint buf, GLenum mode)
 {
@@ -573,17 +590,7 @@ _mesa_BlendEquationiARB(GLuint buf, GLenum mode)
       return;
    }
 
-   if (ctx->Color.Blend[buf].EquationRGB == mode &&
-       ctx->Color.Blend[buf].EquationA == mode)
-      return;  /* no change */
-
-   _mesa_flush_vertices_for_blend_state(ctx);
-   ctx->Color.Blend[buf].EquationRGB = mode;
-   ctx->Color.Blend[buf].EquationA = mode;
-   ctx->Color._BlendEquationPerBuffer = GL_TRUE;
-
-   if (buf == 0)
-      ctx->Color._AdvancedBlendMode = advanced_mode;
+   blend_equationi(ctx, buf, mode, advanced_mode);
 }
 
 
-- 
2.13.3



More information about the mesa-dev mailing list