summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/lines.c
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2000-12-26 05:09:27 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2000-12-26 05:09:27 +0000
commitcab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290 (patch)
tree45385bd755d8e3876c54b2b0113636f5ceb7976a /src/mesa/main/lines.c
parentd1ff1f6798b003a820f5de9fad835ff352f31afe (diff)
downloadexternal_mesa3d-cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290.zip
external_mesa3d-cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290.tar.gz
external_mesa3d-cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290.tar.bz2
Major rework of tnl module
New array_cache module Support 8 texture units in core mesa (now support 8 everywhere) Rework core mesa statechange operations to avoid flushing on many noop statechanges.
Diffstat (limited to 'src/mesa/main/lines.c')
-rw-r--r--src/mesa/main/lines.c34
1 files changed, 21 insertions, 13 deletions
diff --git a/src/mesa/main/lines.c b/src/mesa/main/lines.c
index e23d8a4..c54f108 100644
--- a/src/mesa/main/lines.c
+++ b/src/mesa/main/lines.c
@@ -1,4 +1,4 @@
-/* $Id: lines.c,v 1.23 2000/11/22 07:32:17 joukj Exp $ */
+/* $Id: lines.c,v 1.24 2000/12/26 05:09:29 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -45,22 +45,26 @@ void
_mesa_LineWidth( GLfloat width )
{
GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
if (width<=0.0) {
gl_error( ctx, GL_INVALID_VALUE, "glLineWidth" );
return;
}
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glLineWidth");
- if (ctx->Line.Width != width) {
- ctx->Line.Width = width;
- ctx->_TriangleCaps &= ~DD_LINE_WIDTH;
- if (width != 1.0) ctx->_TriangleCaps |= DD_LINE_WIDTH;
+ if (ctx->Line.Width == width)
+ return;
- ctx->NewState |= _NEW_LINE;
+ FLUSH_VERTICES(ctx, _NEW_LINE);
+ ctx->Line.Width = width;
- if (ctx->Driver.LineWidth)
- (*ctx->Driver.LineWidth)(ctx, width);
- }
+ if (width != 1.0)
+ ctx->_TriangleCaps |= DD_LINE_WIDTH;
+ else
+ ctx->_TriangleCaps &= ~DD_LINE_WIDTH;
+
+ if (ctx->Driver.LineWidth)
+ (*ctx->Driver.LineWidth)(ctx, width);
}
@@ -69,12 +73,16 @@ void
_mesa_LineStipple( GLint factor, GLushort pattern )
{
GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glLineStipple");
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (ctx->Line.StippleFactor == CLAMP( factor, 1, 256 ) &&
+ ctx->Line.StipplePattern == pattern)
+ return;
+
+ FLUSH_VERTICES(ctx, _NEW_LINE);
ctx->Line.StippleFactor = CLAMP( factor, 1, 256 );
ctx->Line.StipplePattern = pattern;
- ctx->NewState |= _NEW_LINE;
-
if (ctx->Driver.LineStipple)
ctx->Driver.LineStipple( ctx, factor, pattern );
}