summaryrefslogtreecommitdiff
path: root/src/mesa/swrast/s_span.c
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-02-24 16:11:43 -0800
committerIan Romanick <ian.d.romanick@intel.com>2010-03-03 12:37:04 -0800
commit7ce12c9024f74bb26e45496a46b57708d8159d37 (patch)
tree40f6330165ad95c2a642f1b70764e58445ca3603 /src/mesa/swrast/s_span.c
parent0ca57295785f3ab040890037e6a2645a70d2b2f2 (diff)
swrast: Remove _swrast_read_index_span
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>
Diffstat (limited to 'src/mesa/swrast/s_span.c')
-rw-r--r--src/mesa/swrast/s_span.c68
1 files changed, 0 insertions, 68 deletions
diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c
index f1f37dfe83..29f070686f 100644
--- a/src/mesa/swrast/s_span.c
+++ b/src/mesa/swrast/s_span.c
@@ -1348,74 +1348,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.
* We can use this for reading any format/type of renderbuffer.