From: Ian Romanick Date: Wed, 24 Feb 2010 23:11:04 +0000 (-0800) Subject: swrast: Remove _swrast_write_zoomed_index_span and associated code X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ef0e02f93d5969e6659f5e41dd572c2db8e20044;p=mesa.git swrast: Remove _swrast_write_zoomed_index_span and associated code After removing support for CopyPixels and DrawPixels involving color-index buffers, _swrast_write_zoomed_index_span is no longer used. Removed it and all the support for COLOR_INDEX formats in zoom_span. Signed-off-by: Ian Romanick --- diff --git a/src/mesa/swrast/s_zoom.c b/src/mesa/swrast/s_zoom.c index bec16208e3d..f224627d50e 100644 --- a/src/mesa/swrast/s_zoom.c +++ b/src/mesa/swrast/s_zoom.c @@ -185,15 +185,6 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span, zoomed.arrayAttribs |= FRAG_BIT_COL0; /* we'll produce these values */ ASSERT(span->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; - ASSERT(span->arrayMask & SPAN_INDEX); - } else if (format == GL_DEPTH_COMPONENT) { /* Copy color info */ zoomed.red = span->red; @@ -288,16 +279,6 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span, } } } - else if (format == GL_COLOR_INDEX) { - const GLuint *indexes = (const GLuint *) src; - GLint i; - for (i = 0; i < zoomedWidth; i++) { - GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x; - ASSERT(j >= 0); - ASSERT(j < (GLint) span->end); - zoomed.array->index[i] = indexes[j]; - } - } else if (format == GL_DEPTH_COMPONENT) { const GLuint *zValues = (const GLuint *) src; GLint i; @@ -307,8 +288,8 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span, ASSERT(j < (GLint) span->end); zoomed.array->z[i] = zValues[j]; } - /* Now, fall into either the RGB or COLOR_INDEX path below */ - format = ctx->Visual.rgbMode ? GL_RGBA : GL_COLOR_INDEX; + /* Now, fall into the RGB path below */ + format = GL_RGBA; } /* write the span in rows [r0, r1) */ @@ -335,22 +316,6 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span, } } } - else if (format == GL_COLOR_INDEX) { - /* use specular color array for temp storage */ - GLuint *indexSave = (GLuint *) zoomed.array->attribs[FRAG_ATTRIB_FOGC]; - const GLint end = zoomed.end; /* save */ - if (y1 - y0 > 1) { - memcpy(indexSave, zoomed.array->index, zoomed.end * sizeof(GLuint)); - } - for (zoomed.y = y0; zoomed.y < y1; zoomed.y++) { - _swrast_write_index_span(ctx, &zoomed); - zoomed.end = end; /* restore */ - if (y1 - y0 > 1) { - /* restore the colors */ - memcpy(zoomed.array->index, indexSave, zoomed.end * sizeof(GLuint)); - } - } - } } @@ -370,15 +335,6 @@ _swrast_write_zoomed_rgb_span(GLcontext *ctx, GLint imgX, GLint imgY, } -void -_swrast_write_zoomed_index_span(GLcontext *ctx, GLint imgX, GLint imgY, - const SWspan *span) -{ - zoom_span(ctx, imgX, imgY, span, - (const GLvoid *) span->array->index, GL_COLOR_INDEX); -} - - void _swrast_write_zoomed_depth_span(GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span) diff --git a/src/mesa/swrast/s_zoom.h b/src/mesa/swrast/s_zoom.h index d2815b41a0e..43917be65fc 100644 --- a/src/mesa/swrast/s_zoom.h +++ b/src/mesa/swrast/s_zoom.h @@ -36,10 +36,6 @@ extern void _swrast_write_zoomed_rgb_span(GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span, const GLvoid *rgb); -extern void -_swrast_write_zoomed_index_span(GLcontext *ctx, GLint imgX, GLint imgY, - const SWspan *span); - extern void _swrast_write_zoomed_depth_span(GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span);