Added few more stubs so that control reaches to DestroyDevice().
[mesa.git] / src / mesa / main / lines.c
index 30eb218808956dbc63eb83b7e310dfa49c763225..78d3a7729b9b2f96733de1e284c0e659731ee7b4 100644 (file)
@@ -1,6 +1,5 @@
 /*
  * Mesa 3-D graphics library
- * Version:  6.5.3
  *
  * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
  *
  *
  * \sa glLineWidth().
  */
-void GLAPIENTRY
-_mesa_LineWidth( GLfloat width )
+static ALWAYS_INLINE void
+line_width(struct gl_context *ctx, GLfloat width, bool no_error)
 {
-   GET_CURRENT_CONTEXT(ctx);
-
-   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.0) {
+   if (!no_error && width <= 0.0F) {
       _mesa_error( ctx, GL_INVALID_VALUE, "glLineWidth" );
       return;
    }
@@ -61,17 +59,16 @@ _mesa_LineWidth( GLfloat width )
     * *NOT* removed in a later spec.  Therefore, we only disallow this in a
     * forward compatible context.
     */
-   if (ctx->API == API_OPENGL_CORE
+   if (!no_error && ctx->API == API_OPENGL_CORE
        && ((ctx->Const.ContextFlags & GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT)
-           != 0)) {
+           != 0)
+       && width > 1.0F) {
       _mesa_error( ctx, GL_INVALID_VALUE, "glLineWidth" );
       return;
    }
 
-   if (ctx->Line.Width == width)
-      return;
-
-   FLUSH_VERTICES(ctx, _NEW_LINE);
+   FLUSH_VERTICES(ctx, ctx->DriverFlags.NewLineState ? 0 : _NEW_LINE);
+   ctx->NewDriverState |= ctx->DriverFlags.NewLineState;
    ctx->Line.Width = width;
 
    if (ctx->Driver.LineWidth)
@@ -79,6 +76,26 @@ _mesa_LineWidth( GLfloat width )
 }
 
 
+void GLAPIENTRY
+_mesa_LineWidth_no_error(GLfloat width)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   line_width(ctx, width, true);
+}
+
+
+void GLAPIENTRY
+_mesa_LineWidth(GLfloat width)
+{
+   GET_CURRENT_CONTEXT(ctx);
+
+   if (MESA_VERBOSE & VERBOSE_API)
+      _mesa_debug(ctx, "glLineWidth %f\n", width);
+
+   line_width(ctx, width, false);
+}
+
+
 /**
  * Set the line stipple pattern.
  *
@@ -105,7 +122,8 @@ _mesa_LineStipple( GLint factor, GLushort pattern )
        ctx->Line.StipplePattern == pattern)
       return;
 
-   FLUSH_VERTICES(ctx, _NEW_LINE);
+   FLUSH_VERTICES(ctx, ctx->DriverFlags.NewLineState ? 0 : _NEW_LINE);
+   ctx->NewDriverState |= ctx->DriverFlags.NewLineState;
    ctx->Line.StippleFactor = factor;
    ctx->Line.StipplePattern = pattern;
 
@@ -122,7 +140,7 @@ _mesa_LineStipple( GLint factor, GLushort pattern )
  * Initializes __struct gl_contextRec::Line and line related constants in
  * __struct gl_contextRec::Const.
  */
-void GLAPIENTRY
+void
 _mesa_init_line( struct gl_context * ctx )
 {
    ctx->Line.SmoothFlag = GL_FALSE;