diff options
author | Keith Whitwell <[email protected]> | 2000-12-26 05:09:27 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2000-12-26 05:09:27 +0000 |
commit | cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290 (patch) | |
tree | 45385bd755d8e3876c54b2b0113636f5ceb7976a /src/mesa/main/lines.c | |
parent | d1ff1f6798b003a820f5de9fad835ff352f31afe (diff) |
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.c | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/src/mesa/main/lines.c b/src/mesa/main/lines.c index e23d8a4de2d..c54f108b237 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 ); } |