if (line.len == 0.0 || IS_INF_OR_NAN(line.len))
return;
- INIT_SPAN(line.span, GL_LINE, 0, 0, SPAN_XY | SPAN_COVERAGE);
-
+ INIT_SPAN(line.span, GL_LINE);
+ line.span.arrayMask = SPAN_XY | SPAN_COVERAGE;
line.xAdj = line.dx / line.len * line.halfWidth;
line.yAdj = line.dy / line.len * line.halfWidth;
(void) swrast;
- INIT_SPAN(span, GL_POLYGON, 0, 0, SPAN_COVERAGE);
+ INIT_SPAN(span, GL_POLYGON);
+ span.arrayMask = SPAN_COVERAGE;
/* determine bottom to top order of vertices */
{
SWspan span;
/* init color span */
- INIT_SPAN(span, GL_BITMAP, width, 0, SPAN_RGBA);
+ INIT_SPAN(span, GL_BITMAP);
+ span.end = width;
+ span.arrayMask = SPAN_RGBA;
span.x = xpos;
span.y = ypos + i;
if (SWRAST_CONTEXT(ctx)->NewState)
_swrast_validate_derived( ctx );
- INIT_SPAN(span, GL_BITMAP, width, 0, SPAN_XY);
+ INIT_SPAN(span, GL_BITMAP);
+ span.end = width;
+ span.arrayMask = SPAN_XY;
_swrast_span_default_attribs(ctx, &span);
for (row = 0; row < height; row++) {
if (SWRAST_CONTEXT(ctx)->NewState)
_swrast_validate_derived( ctx );
- INIT_SPAN(span, GL_BITMAP, width, 0, SPAN_MASK);
+ INIT_SPAN(span, GL_BITMAP);
+ span.end = width;
+ span.arrayMask = SPAN_MASK;
_swrast_span_default_attribs(ctx, &span);
/*span.arrayMask |= SPAN_MASK;*/ /* we'll init span.mask[] */
/* Initialize color span with clear color */
/* XXX optimize for clearcolor == black/zero (bzero) */
- INIT_SPAN(span, GL_BITMAP, width, 0, SPAN_RGBA);
+ INIT_SPAN(span, GL_BITMAP);
+ span.end = width;
+ span.arrayMask = SPAN_RGBA;
span.array->ChanType = rb->DataType;
if (span.array->ChanType == GL_UNSIGNED_BYTE) {
GLubyte clearColor[4];
ASSERT(rb->DataType == GL_UNSIGNED_INT);
/* Initialize index span with clear index */
- INIT_SPAN(span, GL_BITMAP, width, 0, SPAN_INDEX);
+ INIT_SPAN(span, GL_BITMAP);
+ span.end = width;
+ span.arrayMask = SPAN_INDEX;
for (i = 0; i < width;i++) {
span.array->index[i] = ctx->Color.ClearIndex;
}
GLfloat *dest, *tmpImage, *convImage;
SWspan span;
- INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA);
+ INIT_SPAN(span, GL_BITMAP);
_swrast_span_default_attribs(ctx, &span);
+ span.arrayMask = SPAN_RGBA;
+ span.arrayAttribs = FRAG_BIT_COL0;
/* allocate space for GLfloat image */
tmpImage = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat));
stepy = 1;
}
- INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA);
+ INIT_SPAN(span, GL_BITMAP);
_swrast_span_default_attribs(ctx, &span);
+ span.arrayMask = SPAN_RGBA;
span.arrayAttribs = FRAG_BIT_COL0; /* we'll fill in COL0 attrib values */
if (overlapping) {
return;
}
- INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_INDEX);
+ INIT_SPAN(span, GL_BITMAP);
_swrast_span_default_attribs(ctx, &span);
+ span.arrayMask = SPAN_INDEX;
if (ctx->DrawBuffer == ctx->ReadBuffer) {
overlapping = regions_overlap(srcx, srcy, destx, desty, width, height,
return;
}
- INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_Z);
+ INIT_SPAN(span, GL_BITMAP);
_swrast_span_default_attribs(ctx, &span);
+ span.arrayMask = SPAN_Z;
if (ctx->DrawBuffer == ctx->ReadBuffer) {
overlapping = regions_overlap(srcx, srcy, destx, desty, width, height,
return GL_FALSE;
}
- INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA);
+ INIT_SPAN(span, GL_BITMAP);
+ span.arrayMask = SPAN_RGBA;
+ span.arrayAttribs = FRAG_BIT_COL0;
_swrast_span_default_attribs(ctx, &span);
/* copy input params since clipping may change them */
GLint row, skipPixels;
SWspan span;
- INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_INDEX);
+ INIT_SPAN(span, GL_BITMAP);
+ span.arrayMask = SPAN_INDEX;
_swrast_span_default_attribs(ctx, &span);
/*
const GLboolean zoom = ctx->Pixel.ZoomX != 1.0 || ctx->Pixel.ZoomY != 1.0;
SWspan span;
- INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_Z);
+ INIT_SPAN(span, GL_BITMAP);
+ span.arrayMask = SPAN_Z;
_swrast_span_default_attribs(ctx, &span);
if (type == GL_UNSIGNED_SHORT
return;
}
- INIT_SPAN(span, GL_BITMAP, 0, 0x0, SPAN_RGBA);
+ INIT_SPAN(span, GL_BITMAP);
_swrast_span_default_attribs(ctx, &span);
+ span.arrayMask = SPAN_RGBA;
span.arrayAttribs = FRAG_BIT_COL0; /* we're fill in COL0 attrib values */
if (ctx->Pixel.Convolution2DEnabled || ctx->Pixel.Separable2DEnabled) {
}
#endif
- INIT_SPAN(span, GL_LINE, numPixels, interpFlags, SPAN_XY);
+ INIT_SPAN(span, GL_LINE);
+ span.end = numPixels;
+ span.interpMask = interpFlags;
+ span.arrayMask = SPAN_XY;
/*
* Draw
size = CLAMP(size, ctx->Const.MinPointSize, ctx->Const.MaxPointSize);
/* span init */
- INIT_SPAN(span, GL_POINT, 0, 0, 0);
+ INIT_SPAN(span, GL_POINT);
span.interpMask = SPAN_Z | SPAN_RGBA;
span.red = ChanToFixed(vert->color[0]);
(void) alphaAtten; /* not used */
/* span init */
- INIT_SPAN(span, GL_POINT, 0, 0, 0);
+ INIT_SPAN(span, GL_POINT);
span.interpMask = SPAN_Z | SPAN_RGBA;
span.arrayMask = SPAN_COVERAGE | SPAN_MASK;
size = CLAMP(size, ctx->Const.MinPointSize, ctx->Const.MaxPointSize);
/* span init */
- INIT_SPAN(span, GL_POINT, 0, 0, 0);
+ INIT_SPAN(span, GL_POINT);
span.arrayMask = SPAN_XY;
if (ciMode) {
-#define INIT_SPAN(S, PRIMITIVE, END, INTERP_MASK, ARRAY_MASK) \
-do { \
- (S).primitive = (PRIMITIVE); \
- (S).interpMask = (INTERP_MASK); \
- (S).arrayMask = (ARRAY_MASK); \
- (S).arrayAttribs = 0x0; \
- (S).end = (END); \
- (S).facing = 0; \
- (S).array = SWRAST_CONTEXT(ctx)->SpanArrays; \
+#define INIT_SPAN(S, PRIMITIVE) \
+do { \
+ (S).primitive = (PRIMITIVE); \
+ (S).interpMask = 0x0; \
+ (S).arrayMask = 0x0; \
+ (S).arrayAttribs = 0x0; \
+ (S).end = 0; \
+ (S).facing = 0; \
+ (S).array = SWRAST_CONTEXT(ctx)->SpanArrays; \
} while (0)
(void) swrast;
- INIT_SPAN(span, GL_POLYGON, 0, 0, 0);
+ INIT_SPAN(span, GL_POLYGON);
span.y = 0; /* silence warnings */
#ifdef INTERP_Z
ASSERT((span->arrayMask & SPAN_XY) == 0);
ASSERT(span->primitive == GL_BITMAP);
- INIT_SPAN(zoomed, GL_BITMAP, 0, 0, 0);
+ INIT_SPAN(zoomed, GL_BITMAP);
zoomed.x = x0;
zoomed.end = zoomedWidth;
zoomed.array = &zoomed_arrays;