swrast: Remove _swrast_write_zoomed_index_span and associated code
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 24 Feb 2010 23:11:04 +0000 (15:11 -0800)
committerIan Romanick <ian.d.romanick@intel.com>
Wed, 3 Mar 2010 20:37:03 +0000 (12:37 -0800)
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 <ian.d.romanick@intel.com>
src/mesa/swrast/s_zoom.c
src/mesa/swrast/s_zoom.h

index bec16208e3d9b50fbfcf57ac14d944ec8225fcab..f224627d50eac2ac8b8b3eceed4ed6db2d4cdd1b 100644 (file)
@@ -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)
index d2815b41a0eaa4b0551d2507ed49f4126ba2a32a..43917be65fc93494c25eb035a1952e7f0df42c76 100644 (file)
@@ -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);