[Mesa-dev] [PATCH 076/101] mesa: add point_size() helper
Samuel Pitoiset
samuel.pitoiset at gmail.com
Fri Jul 21 17:40:25 UTC 2017
Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
src/mesa/main/points.c | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/src/mesa/main/points.c b/src/mesa/main/points.c
index 2d62e73c12..012fac5b3c 100644
--- a/src/mesa/main/points.c
+++ b/src/mesa/main/points.c
@@ -40,6 +40,20 @@
* \param size point diameter in pixels
* \sa glPointSize().
*/
+static void
+point_size(struct gl_context *ctx, GLfloat size)
+{
+ if (ctx->Point.Size == size)
+ return;
+
+ FLUSH_VERTICES(ctx, _NEW_POINT);
+ ctx->Point.Size = size;
+
+ if (ctx->Driver.PointSize)
+ ctx->Driver.PointSize(ctx, size);
+}
+
+
void GLAPIENTRY
_mesa_PointSize( GLfloat size )
{
@@ -50,14 +64,7 @@ _mesa_PointSize( GLfloat size )
return;
}
- if (ctx->Point.Size == size)
- return;
-
- FLUSH_VERTICES(ctx, _NEW_POINT);
- ctx->Point.Size = size;
-
- if (ctx->Driver.PointSize)
- ctx->Driver.PointSize(ctx, size);
+ point_size(ctx, size);
}
--
2.13.3
More information about the mesa-dev
mailing list