summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/points.c
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2017-07-20 10:18:10 +0200
committerSamuel Pitoiset <[email protected]>2017-07-31 13:53:40 +0200
commit1693ab6c3aabba33902f24789519a08b461e3f30 (patch)
tree372e6d69f56d46c3a839efcbd0ad927c4325b98a /src/mesa/main/points.c
parentd88d60ab1d1992a59c7ed6c97b6d6c6990671067 (diff)
mesa: add point_size() helper
Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/mesa/main/points.c')
-rw-r--r--src/mesa/main/points.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/mesa/main/points.c b/src/mesa/main/points.c
index 2d62e73c126..012fac5b3cb 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);
}