swrast: Remove _swrast_read_index_span
authorIan Romanick <ian.d.romanick@intel.com>
Thu, 25 Feb 2010 00:11:43 +0000 (16:11 -0800)
committerIan Romanick <ian.d.romanick@intel.com>
Wed, 3 Mar 2010 20:37:04 +0000 (12:37 -0800)
After all the recent color-index rendering removal,
_swrast_read_index_span is no longer used anywhere.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/swrast/s_span.c
src/mesa/swrast/s_span.h

index f1f37dfe837ff4bec48b1a2ca7917930a620106e..29f070686fe81b2fe046835fd0cc840a786a1d91 100644 (file)
@@ -1347,74 +1347,6 @@ _swrast_read_rgba_span( GLcontext *ctx, struct gl_renderbuffer *rb,
 }
 
 
-/**
- * Read CI pixels from a renderbuffer.  Clipping will be done to prevent
- * reading ouside the buffer's boundaries.
- */
-void
-_swrast_read_index_span( GLcontext *ctx, struct gl_renderbuffer *rb,
-                         GLuint n, GLint x, GLint y, GLuint index[] )
-{
-   const GLint bufWidth = (GLint) rb->Width;
-   const GLint bufHeight = (GLint) rb->Height;
-
-   if (y < 0 || y >= bufHeight || x + (GLint) n < 0 || x >= bufWidth) {
-      /* completely above, below, or right */
-      memset(index, 0, n * sizeof(GLuint));
-   }
-   else {
-      GLint skip, length;
-      if (x < 0) {
-         /* left edge clipping */
-         skip = -x;
-         length = (GLint) n - skip;
-         if (length < 0) {
-            /* completely left of window */
-            return;
-         }
-         if (length > bufWidth) {
-            length = bufWidth;
-         }
-      }
-      else if ((GLint) (x + n) > bufWidth) {
-         /* right edge clipping */
-         skip = 0;
-         length = bufWidth - x;
-         if (length < 0) {
-            /* completely to right of window */
-            return;
-         }
-      }
-      else {
-         /* no clipping */
-         skip = 0;
-         length = (GLint) n;
-      }
-
-      ASSERT(rb->GetRow);
-      ASSERT(rb->_BaseFormat == GL_COLOR_INDEX);
-
-      if (rb->DataType == GL_UNSIGNED_BYTE) {
-         GLubyte index8[MAX_WIDTH];
-         GLint i;
-         rb->GetRow(ctx, rb, length, x + skip, y, index8);
-         for (i = 0; i < length; i++)
-            index[skip + i] = index8[i];
-      }
-      else if (rb->DataType == GL_UNSIGNED_SHORT) {
-         GLushort index16[MAX_WIDTH];
-         GLint i;
-         rb->GetRow(ctx, rb, length, x + skip, y, index16);
-         for (i = 0; i < length; i++)
-            index[skip + i] = index16[i];
-      }
-      else if (rb->DataType == GL_UNSIGNED_INT) {
-         rb->GetRow(ctx, rb, length, x + skip, y, index + skip);
-      }
-   }
-}
-
-
 /**
  * Wrapper for gl_renderbuffer::GetValues() which does clipping to avoid
  * reading values outside the buffer bounds.
index 9f6be5a33587f1a248969783c81791c7b09cee42..1ce3f5f5e57c9116646f4e199de5cf382ac65cb8 100644 (file)
@@ -196,10 +196,6 @@ extern void
 _swrast_read_rgba_span(GLcontext *ctx, struct gl_renderbuffer *rb,
                        GLuint n, GLint x, GLint y, GLenum type, GLvoid *rgba);
 
-extern void
-_swrast_read_index_span( GLcontext *ctx, struct gl_renderbuffer *rb,
-                         GLuint n, GLint x, GLint y, GLuint indx[] );
-
 extern void
 _swrast_get_values(GLcontext *ctx, struct gl_renderbuffer *rb,
                    GLuint count, const GLint x[], const GLint y[],