mesa: add point_size() helper
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 20 Jul 2017 08:18:10 +0000 (10:18 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 31 Jul 2017 11:53:40 +0000 (13:53 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/mesa/main/points.c

index 2d62e73..012fac5 100644 (file)
  * \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);
 }