{
/* XXX double-check/verify this arithmetic */
const float a0 = setup->vmin->data[vertSlot][i] * setup->vmin->data[0][3];
- const float a1 = setup->vmax->data[vertSlot][i] * setup->vmin->data[0][3];
+ const float a1 = setup->vmax->data[vertSlot][i] * setup->vmax->data[0][3];
const float da = a1 - a0;
const float dadx = da * setup->emaj.dx * setup->oneoverarea;
const float dady = da * setup->emaj.dy * setup->oneoverarea;
}
-/**
- * Determine whether or not to emit a line fragment by checking
- * line stipple pattern.
- */
-static INLINE unsigned
-stipple_test(int counter, ushort pattern, int factor)
-{
- int b = (counter / factor) & 0xf;
- return (1 << b) & pattern;
-}
-
-
/**
* Do setup for line rasterization, then render the line.
- * XXX single-pixel width, no stipple, etc
+ * Single-pixel width, no stipple, etc. We rely on the 'draw' module
+ * to handle stippling and wide lines.
*/
static void
setup_line(struct draw_stage *stage, struct prim_header *prim)
const struct vertex_header *v0 = prim->v[0];
const struct vertex_header *v1 = prim->v[1];
struct setup_stage *setup = setup_stage( stage );
- struct softpipe_context *sp = setup->softpipe;
-
int x0 = (int) v0->data[0][0];
int x1 = (int) v1->data[0][0];
int y0 = (int) v0->data[0][1];
const int errorDec = error - dx;
for (i = 0; i < dx; i++) {
- if (!sp->rasterizer->line_stipple_enable ||
- stipple_test(sp->line_stipple_counter,
- (ushort) sp->rasterizer->line_stipple_pattern,
- sp->rasterizer->line_stipple_factor + 1)) {
- plot(setup, x0, y0);
- }
+ plot(setup, x0, y0);
x0 += xstep;
if (error < 0) {
error += errorDec;
y0 += ystep;
}
-
- sp->line_stipple_counter++;
}
}
else {
const int errorDec = error - dy;
for (i = 0; i < dy; i++) {
- if (!sp->rasterizer->line_stipple_enable ||
- stipple_test(sp->line_stipple_counter,
- (ushort) sp->rasterizer->line_stipple_pattern,
- sp->rasterizer->line_stipple_factor + 1)) {
- plot(setup, x0, y0);
- }
+ plot(setup, x0, y0);
y0 += ystep;
-
if (error < 0) {
error += errorInc;
}
error += errorDec;
x0 += xstep;
}
-
- sp->line_stipple_counter++;
}
}
static void reset_stipple_counter( struct draw_stage *stage )
{
- struct setup_stage *setup = setup_stage(stage);
- setup->softpipe->line_stipple_counter = 0;
}