r300: Further reduced the radeon_span.c diff.
[mesa.git] / src / mesa / swrast / s_lines.c
index dccc92cbd284b387ecea4426b84d011616758c0e..80702e41a3ccff62e07feb91002adbd903897f33 100644 (file)
@@ -1,8 +1,8 @@
 /*
  * Mesa 3-D graphics library
- * Version:  6.5
+ * Version:  6.5.3
  *
- * Copyright (C) 1999-2005  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2007  Brian Paul   All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -27,7 +27,6 @@
 #include "context.h"
 #include "colormac.h"
 #include "macros.h"
-#include "nvfragprog.h"
 #include "s_aaline.h"
 #include "s_context.h"
 #include "s_depth.h"
@@ -62,7 +61,7 @@ compute_stipple_mask( GLcontext *ctx, GLuint len, GLubyte mask[] )
  * To draw a wide line we can simply redraw the span N times, side by side.
  */
 static void
-draw_wide_line( GLcontext *ctx, struct sw_span *span, GLboolean xMajor )
+draw_wide_line( GLcontext *ctx, SWspan *span, GLboolean xMajor )
 {
    GLint width, start;
 
@@ -172,33 +171,13 @@ draw_wide_line( GLcontext *ctx, struct sw_span *span, GLboolean xMajor )
 #include "s_linetemp.h"
 
 
-/* Single-texture line, w/ fog, Z, specular, etc. */
+/* General-purpose textured line (any/all features). */
 #define NAME textured_line
 #define INTERP_RGBA
-#define INTERP_Z
-#define INTERP_FOG
-#define INTERP_TEX
-#define RENDER_SPAN(span)                                      \
-   if (ctx->Line.StippleFlag) {                                        \
-      span.arrayMask |= SPAN_MASK;                             \
-      compute_stipple_mask(ctx, span.end, span.array->mask);   \
-   }                                                           \
-   if (ctx->Line._Width > 1.0) {                                       \
-      draw_wide_line(ctx, &span, (GLboolean)(dx > dy));                \
-   }                                                           \
-   else {                                                      \
-      _swrast_write_rgba_span(ctx, &span);                     \
-   }
-#include "s_linetemp.h"
-
-
-/* Multi-texture or separate specular line, w/ fog, Z, specular, etc. */
-#define NAME multitextured_line
-#define INTERP_RGBA
 #define INTERP_SPEC
 #define INTERP_Z
 #define INTERP_FOG
-#define INTERP_MULTITEX
+#define INTERP_ATTRIBS
 #define RENDER_SPAN(span)                                      \
    if (ctx->Line.StippleFlag) {                                        \
       span.arrayMask |= SPAN_MASK;                             \
@@ -251,8 +230,6 @@ _mesa_print_line_function(GLcontext *ctx)
       _mesa_printf("general_rgba_line\n");
    else if (swrast->Line == textured_line)
       _mesa_printf("textured_line\n");
-   else if (swrast->Line == multitextured_line)
-      _mesa_printf("multitextured_line\n");
    else
       _mesa_printf("Driver func %p\n", (void *(*)()) swrast->Line);
 }
@@ -299,16 +276,10 @@ _swrast_choose_line( GLcontext *ctx )
          _swrast_choose_aa_line_function(ctx);
          ASSERT(swrast->Line);
       }
-      else if (ctx->Texture._EnabledCoordUnits) {
+      else if (ctx->Texture._EnabledCoordUnits
+             || ctx->FragmentProgram._Current) {
          /* textured lines */
-         if (ctx->Texture._EnabledCoordUnits > 0x1
-             || NEED_SECONDARY_COLOR(ctx)) {
-            /* multi-texture and/or separate specular color */
-            USE(multitextured_line);
-         }
-         else {
-            USE(textured_line);
-         }
+         USE(textured_line);
       }
       else if (ctx->Depth.Test || swrast->_FogEnabled || ctx->Line._Width != 1.0
                || ctx->Line.StippleFlag) {