summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/lines.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2015-10-21 13:58:04 -0600
committerBrian Paul <[email protected]>2015-10-22 17:19:20 -0600
commitdf0f817e311dbf9af110779086a27429905b1faf (patch)
tree3003025f198b917a6cda5343e1e5464aec5c0297 /src/mesa/main/lines.c
parent990afdc04551e89ec9b5d29a05a9da798c07ccc3 (diff)
mesa: check for unchanged line width before error checking
Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/mesa/main/lines.c')
-rw-r--r--src/mesa/main/lines.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mesa/main/lines.c b/src/mesa/main/lines.c
index c020fb3eb9e..93b80af0dc4 100644
--- a/src/mesa/main/lines.c
+++ b/src/mesa/main/lines.c
@@ -45,6 +45,10 @@ _mesa_LineWidth( GLfloat width )
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glLineWidth %f\n", width);
+ /* If width is unchanged, there can't be an error */
+ if (ctx->Line.Width == width)
+ return;
+
if (width <= 0.0F) {
_mesa_error( ctx, GL_INVALID_VALUE, "glLineWidth" );
return;
@@ -68,9 +72,6 @@ _mesa_LineWidth( GLfloat width )
return;
}
- if (ctx->Line.Width == width)
- return;
-
FLUSH_VERTICES(ctx, _NEW_LINE);
ctx->Line.Width = width;