/* DO_Z */
GLfloat zPlane[4];
- /* DO_RGBA */
+ /* DO_RGBA - always enabled */
GLfloat rPlane[4], gPlane[4], bPlane[4], aPlane[4];
- /* DO_INDEX */
- GLfloat iPlane[4];
/* DO_ATTRIBS */
GLfloat wPlane[4];
GLfloat attrPlane[FRAG_ATTRIB_MAX][4][4];
}
-/**
- * Compute coverage value for color index mode.
- * XXX this may not be quite correct.
- * \return coverage in [0,15].
- */
-static GLfloat
-compute_coveragei(const struct LineInfo *info,
- GLint winx, GLint winy)
-{
- return compute_coveragef(info, winx, winy) * 15.0F;
-}
-
-
-
typedef void (*plot_func)(GLcontext *ctx, struct LineInfo *line,
int ix, int iy);
}
-#define NAME(x) aa_ci_##x
-#define DO_Z
-#define DO_ATTRIBS /* for fog */
-#define DO_INDEX
-#include "s_aalinetemp.h"
-
-
#define NAME(x) aa_rgba_##x
#define DO_Z
-#define DO_RGBA
#include "s_aalinetemp.h"
#define NAME(x) aa_general_rgba_##x
#define DO_Z
-#define DO_RGBA
#define DO_ATTRIBS
#include "s_aalinetemp.h"
ASSERT(ctx->Line.SmoothFlag);
- if (ctx->Visual.rgbMode) {
- /* RGBA */
- if (ctx->Texture._EnabledCoordUnits != 0
- || ctx->FragmentProgram._Current
- || (ctx->Light.Enabled &&
- ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)
- || ctx->Fog.ColorSumEnabled
- || swrast->_FogEnabled) {
- swrast->Line = aa_general_rgba_line;
- }
- else {
- swrast->Line = aa_rgba_line;
- }
+ if (ctx->Texture._EnabledCoordUnits != 0
+ || ctx->FragmentProgram._Current
+ || (ctx->Light.Enabled &&
+ ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)
+ || ctx->Fog.ColorSumEnabled
+ || swrast->_FogEnabled) {
+ swrast->Line = aa_general_rgba_line;
}
else {
- /* Color Index */
- swrast->Line = aa_ci_line;
+ swrast->Line = aa_rgba_line;
}
}
const SWcontext *swrast = SWRAST_CONTEXT(ctx);
const GLfloat fx = (GLfloat) ix;
const GLfloat fy = (GLfloat) iy;
-#ifdef DO_INDEX
- const GLfloat coverage = compute_coveragei(line, ix, iy);
-#else
const GLfloat coverage = compute_coveragef(line, ix, iy);
-#endif
const GLuint i = line->span.end;
(void) swrast;
#ifdef DO_Z
line->span.array->z[i] = (GLuint) solve_plane(fx, fy, line->zPlane);
#endif
-#ifdef DO_RGBA
line->span.array->rgba[i][RCOMP] = solve_plane_chan(fx, fy, line->rPlane);
line->span.array->rgba[i][GCOMP] = solve_plane_chan(fx, fy, line->gPlane);
line->span.array->rgba[i][BCOMP] = solve_plane_chan(fx, fy, line->bPlane);
line->span.array->rgba[i][ACOMP] = solve_plane_chan(fx, fy, line->aPlane);
-#endif
-#ifdef DO_INDEX
- line->span.array->index[i] = (GLint) solve_plane(fx, fy, line->iPlane);
-#endif
#if defined(DO_ATTRIBS)
ATTRIB_LOOP_BEGIN
GLfloat (*attribArray)[4] = line->span.array->attribs[attr];
#endif
if (line->span.end == MAX_WIDTH) {
-#if defined(DO_RGBA)
_swrast_write_rgba_span(ctx, &(line->span));
-#else
- _swrast_write_index_span(ctx, &(line->span));
-#endif
line->span.end = 0; /* reset counter */
}
}
compute_plane(line.x0, line.y0, line.x1, line.y1,
v0->attrib[FRAG_ATTRIB_WPOS][2], v1->attrib[FRAG_ATTRIB_WPOS][2], line.zPlane);
#endif
-#ifdef DO_RGBA
line.span.arrayMask |= SPAN_RGBA;
if (ctx->Light.ShadeModel == GL_SMOOTH) {
compute_plane(line.x0, line.y0, line.x1, line.y1,
constant_plane(v1->color[BCOMP], line.bPlane);
constant_plane(v1->color[ACOMP], line.aPlane);
}
-#endif
-#ifdef DO_INDEX
- line.span.arrayMask |= SPAN_INDEX;
- if (ctx->Light.ShadeModel == GL_SMOOTH) {
- compute_plane(line.x0, line.y0, line.x1, line.y1,
- v0->attrib[FRAG_ATTRIB_CI][0],
- v1->attrib[FRAG_ATTRIB_CI][0], line.iPlane);
- }
- else {
- constant_plane(v1->attrib[FRAG_ATTRIB_CI][0], line.iPlane);
- }
-#endif
#if defined(DO_ATTRIBS)
{
const GLfloat invW0 = v0->attrib[FRAG_ATTRIB_WPOS][3];
segment(ctx, &line, NAME(plot), 0.0, 1.0);
}
-#if defined(DO_RGBA)
_swrast_write_rgba_span(ctx, &(line.span));
-#else
- _swrast_write_index_span(ctx, &(line.span));
-#endif
}
#undef DO_Z
-#undef DO_RGBA
-#undef DO_INDEX
#undef DO_ATTRIBS
#undef NAME