Mesa (master): mesa: check for unchanged line width before error checking

Brian Paul brianp at kemper.freedesktop.org
Thu Oct 22 23:19:52 UTC 2015


Module: Mesa
Branch: master
Commit: df0f817e311dbf9af110779086a27429905b1faf
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=df0f817e311dbf9af110779086a27429905b1faf

Author: Brian Paul <brianp at vmware.com>
Date:   Wed Oct 21 13:58:04 2015 -0600

mesa: check for unchanged line width before error checking

Reviewed-by: Matt Turner <mattst88 at gmail.com>

---

 src/mesa/main/lines.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/mesa/main/lines.c b/src/mesa/main/lines.c
index c020fb3..93b80af 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;
 




More information about the mesa-commit mailing list