- GLint m;
- GLint r0, r1, row, r;
- GLint i, j, skipcol;
- GLchan zrgba[MAX_WIDTH][4]; /* zoomed pixel colors */
- GLdepth zdepth[MAX_WIDTH]; /* zoomed depth values */
- GLfixed zfog[MAX_WIDTH]; /* zoomed fog values */
- GLint maxwidth = MIN2( ctx->DrawBuffer->Width, MAX_WIDTH );
- const GLuint *srcRGBA32 = (const GLuint *) rgba;
- GLuint *dstRGBA32 = (GLuint *) zrgba;
-
- /* compute width of output row */
- m = (GLint) ABSF( n * ctx->Pixel.ZoomX );
- if (m==0) {
+ GLint r0, r1, row;
+ GLint c0, c1, skipCol;
+ GLint i, j;
+ const GLuint maxWidth = MIN2( ctx->DrawBuffer->Width, MAX_WIDTH );
+ struct sw_span zoomed;
+ struct span_arrays zoomed_arrays; /* this is big! */
+
+ /* no pixel arrays! must be horizontal spans. */
+ ASSERT((span->arrayMask & SPAN_XY) == 0);
+ ASSERT(span->primitive == GL_BITMAP);
+
+ INIT_SPAN(zoomed, GL_BITMAP, 0, 0, 0);
+ zoomed.array = &zoomed_arrays;
+
+ /* copy fog interp info */
+ zoomed.fog = span->fog;
+ zoomed.fogStep = span->fogStep;
+ /* XXX copy texcoord info? */
+
+ if (format == GL_RGBA || format == GL_RGB) {
+ /* copy Z info */
+ zoomed.z = span->z;
+ zoomed.zStep = span->zStep;
+ /* we'll generate an array of colorss */
+ zoomed.interpMask = span->interpMask & ~SPAN_RGBA;
+ zoomed.arrayMask |= SPAN_RGBA;
+ }
+ else if (format == GL_COLOR_INDEX) {
+ /* copy Z info */
+ zoomed.z = span->z;
+ zoomed.zStep = span->zStep;
+ /* we'll generate an array of color indexes */
+ zoomed.interpMask = span->interpMask & ~SPAN_INDEX;
+ zoomed.arrayMask |= SPAN_INDEX;
+ }
+ else {
+ assert(format == GL_DEPTH_COMPONENT);
+ /* Copy color info */
+ zoomed.red = span->red;
+ zoomed.green = span->green;
+ zoomed.blue = span->blue;
+ zoomed.alpha = span->alpha;
+ zoomed.redStep = span->redStep;
+ zoomed.greenStep = span->greenStep;
+ zoomed.blueStep = span->blueStep;
+ zoomed.alphaStep = span->alphaStep;
+ /* we'll generate an array of depth values */
+ zoomed.interpMask = span->interpMask & ~SPAN_Z;
+ zoomed.arrayMask |= SPAN_Z;
+ }
+
+ /*
+ * Compute which columns to draw: [c0, c1)
+ */
+ c0 = (GLint) (span->x + skipPixels * ctx->Pixel.ZoomX);
+ c1 = (GLint) (span->x + (skipPixels + span->end) * ctx->Pixel.ZoomX);
+ if (c0 == c1) {