-/* $Id: s_drawpix.c,v 1.43 2003/01/15 23:46:34 brianp Exp $ */
+/* $Id: s_drawpix.c,v 1.44 2003/01/16 18:57:44 brianp Exp $ */
/*
* Mesa 3-D graphics library
*/
skipPixels = 0;
while (skipPixels < width) {
- span.x = x + (zoom ? 0 : skipPixels);
- span.y = y;
- span.end = (width - skipPixels > MAX_WIDTH)
- ? MAX_WIDTH : (width - skipPixels);
- ASSERT(span.end <= MAX_WIDTH);
+ const GLint spanX = x + (zoom ? 0 : skipPixels);
+ GLint spanY = y;
+ const GLint spanEnd = (width - skipPixels > MAX_WIDTH)
+ ? MAX_WIDTH : (width - skipPixels);
+ ASSERT(spanEnd <= MAX_WIDTH);
for (row = 0; row < height; row++, span.y++) {
const GLvoid *source = _mesa_image_address(&ctx->Unpack, pixels,
width, height,
_mesa_unpack_index_span(ctx, span.end, GL_UNSIGNED_INT,
span.array->index, type, source, &ctx->Unpack,
ctx->_ImageTransferState);
+
+ /* These may get changed during writing/clipping */
+ span.x = spanX;
+ span.y = spanY;
+ span.end = spanEnd;
+
if (zoom)
_mesa_write_zoomed_index_span(ctx, &span, y, skipPixels);
else
_mesa_write_index_span(ctx, &span);
}
- skipPixels += span.end;
+ skipPixels += spanEnd;
}
}
_mesa_write_index_span(ctx, &span);
}
}
- skipPixels += span.end;
+ skipPixels += spanEnd;
}
}
}
* General solution
*/
{
+ const GLuint interpMask = span.interpMask;
+ const GLuint arrayMask = span.arrayMask;
GLint row, skipPixels = 0;
/* if the span is wider than MAX_WIDTH we have to do it in chunks */
span.x = spanX;
span.y = spanY;
span.end = spanEnd;
+ span.arrayMask = arrayMask;
+ span.interpMask = interpMask;
_mesa_unpack_chan_color_span(ctx, span.end, GL_RGBA,
(GLchan *) span.array->rgba,
_swrast_pixel_texture(ctx, &span);
}
+ /* draw the span */
if (quickDraw) {
(*swrast->Driver.WriteRGBASpan)(ctx, span.end, span.x, span.y,
(CONST GLchan (*)[4]) span.array->rgba, NULL);
_mesa_write_rgba_span(ctx, &span);
}
}
- skipPixels += span.end;
+
+ skipPixels += spanEnd;
}
}