* Triangle edge info
*/
struct edge {
- GLfloat dx; /* X(v1) - X(v0), used only during setup */
- GLfloat dy; /* Y(v1) - Y(v0), used only during setup */
- GLfloat dxdy; /* dx/dy */
- GLfloat sx; /* first sample point x coord */
- GLfloat sy;
- GLint lines; /* number of lines on this edge */
+ GLfloat dx; /**< X(v1) - X(v0), used only during setup */
+ GLfloat dy; /**< Y(v1) - Y(v0), used only during setup */
+ GLfloat dxdy; /**< dx/dy */
+ GLfloat sx, sy; /**< first sample point coord */
+ GLint lines; /**< number of lines on this edge */
};
struct setup_stage {
struct draw_stage stage; /**< This must be first (base class) */
- /*XXX NEW */
struct softpipe_context *softpipe;
/* Vertices are just an array of floats making up each attribute in
/**
* Basically a cast wrapper.
*/
-static inline struct setup_stage *setup_stage( struct draw_stage *stage )
+static INLINE struct setup_stage *setup_stage( struct draw_stage *stage )
{
return (struct setup_stage *)stage;
}
/**
- * Emit/render a quad.
- * Called during point/line rendering. For triangles, we call
- * run_shader_block() which doesn't do clipping (since clipping is
- * done at a higher level for tris).
- * This passes the quad to the first stage of per-fragment operations.
+ * Emit a quad (pass to next stage) with clipping.
*/
static INLINE void
-quad_emit(struct setup_stage *setup)
+clip_emit_quad(struct setup_stage *setup)
{
quad_clip(setup);
if (setup->quad.mask) {
/**
- * Given an X or Y coordinate, return the block/quad coordinate that it
- * belongs to.
+ * Emit a quad (pass to next stage). No clipping is done.
*/
-static inline GLint block( GLint x )
+static INLINE void
+emit_quad( struct setup_stage *setup, GLint x, GLint y, GLuint mask )
{
- return x & ~1;
+ struct softpipe_context *sp = setup->softpipe;
+ setup->quad.x0 = x;
+ setup->quad.y0 = y;
+ setup->quad.mask = mask;
+ sp->quad.first->run(sp->quad.first, &setup->quad);
}
-
/**
- * Run shader on a quad/block.
+ * Given an X or Y coordinate, return the block/quad coordinate that it
+ * belongs to.
*/
-static void run_shader_block( struct setup_stage *setup,
- GLint x, GLint y, GLuint mask )
+static INLINE GLint block( GLint x )
{
- struct softpipe_context *sp = setup->softpipe;
- setup->quad.x0 = x;
- setup->quad.y0 = y;
- setup->quad.mask = mask;
- sp->quad.first->run(sp->quad.first, &setup->quad);
+ return x & ~1;
}
for (x = block(minleft); x <= block(maxright); )
{
- run_shader_block( setup, x,
- setup->span.y,
- calculate_mask( setup, x ) );
+ emit_quad( setup, x, setup->span.y,
+ calculate_mask( setup, x ) );
x += 2;
}
/* flush prev quad, start new quad */
if (setup->quad.x0 != -1)
- quad_emit(setup);
+ clip_emit_quad(setup);
setup->quad.x0 = quadX;
setup->quad.y0 = quadY;
/* draw final quad */
if (setup->quad.mask) {
- quad_emit(setup);
+ clip_emit_quad(setup);
}
}
setup->quad.x0 = x - ix;
setup->quad.y0 = y - iy;
setup->quad.mask = (1 << ix) << (2 * iy);
- quad_emit(setup);
+ clip_emit_quad(setup);
}
else {
const GLint ixmin = block((GLint) (x - halfSize));
if (setup->quad.mask) {
setup->quad.x0 = ix;
setup->quad.y0 = iy;
- quad_emit(setup);
+ clip_emit_quad(setup);
}
}
}
if (setup->quad.mask) {
setup->quad.x0 = ix;
setup->quad.y0 = iy;
- quad_emit(setup);
+ clip_emit_quad(setup);
}
}
}