summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2011-12-24 08:54:26 -0700
committerBrian Paul <[email protected]>2011-12-24 08:54:26 -0700
commitfc41473b9f7d1171a2921a825807889b8fcbcaaf (patch)
tree436f32a8177ad21b34660d14023312a8a02380bd /src/mesa/drivers/dri
parentc4b5f0cadb18bad22b4c28424723a09832209c6f (diff)
mesa: remove gl_renderbufer::PutMonoRow() and PutMonoValues()
The former was only used for clearing buffers. The later wasn't used anywhere! Remove them and all implementations of those functions. Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r--src/mesa/drivers/dri/common/depthtmp.h59
-rw-r--r--src/mesa/drivers/dri/common/spantmp2.h118
-rw-r--r--src/mesa/drivers/dri/common/stenciltmp.h58
-rw-r--r--src/mesa/drivers/dri/swrast/swrast_span.c16
-rw-r--r--src/mesa/drivers/dri/swrast/swrast_spantemp.h57
5 files changed, 1 insertions, 307 deletions
diff --git a/src/mesa/drivers/dri/common/depthtmp.h b/src/mesa/drivers/dri/common/depthtmp.h
index c6e2bb75c16..31ebc68ee82 100644
--- a/src/mesa/drivers/dri/common/depthtmp.h
+++ b/src/mesa/drivers/dri/common/depthtmp.h
@@ -71,63 +71,6 @@ static void TAG(WriteDepthSpan)( struct gl_context *ctx,
}
-#if HAVE_HW_DEPTH_SPANS
-/* implement MonoWriteDepthSpan() in terms of WriteDepthSpan() */
-static void
-TAG(WriteMonoDepthSpan)( struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- const void *value, const GLubyte mask[] )
-{
- const GLuint depthVal = *((GLuint *) value);
- GLuint depths[MAX_WIDTH];
- GLuint i;
- for (i = 0; i < n; i++)
- depths[i] = depthVal;
- TAG(WriteDepthSpan)(ctx, rb, n, x, y, depths, mask);
-}
-#else
-static void TAG(WriteMonoDepthSpan)( struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- const void *value,
- const GLubyte mask[] )
-{
- HW_WRITE_LOCK()
- {
- const GLuint depth = *((GLuint *) value);
- GLint x1;
- GLint n1;
- LOCAL_DEPTH_VARS;
-
- y = Y_FLIP( y );
-
- HW_CLIPLOOP()
- {
- GLint i = 0;
- CLIPSPAN( x, y, n, x1, n1, i );
-
- if ( DBG ) fprintf( stderr, "%s %d..%d (x1 %d) = %u\n",
- __FUNCTION__, (int)i, (int)n1, (int)x1, (GLuint)depth );
-
- if ( mask ) {
- for ( ; n1>0 ; i++, x1++, n1-- ) {
- if ( mask[i] ) WRITE_DEPTH( x1, y, depth );
- }
- } else {
- for ( ; n1>0 ; x1++, n1-- ) {
- WRITE_DEPTH( x1, y, depth );
- }
- }
- }
- HW_ENDCLIPLOOP();
- }
- HW_WRITE_UNLOCK();
-
- (void) ctx;
-}
-#endif
-
-
static void TAG(WriteDepthPixels)( struct gl_context *ctx,
struct gl_renderbuffer *rb,
GLuint n,
@@ -259,9 +202,7 @@ static void TAG(InitDepthPointers)(struct gl_renderbuffer *rb)
rb->GetValues = TAG(ReadDepthPixels);
rb->PutRow = TAG(WriteDepthSpan);
rb->PutRowRGB = NULL;
- rb->PutMonoRow = TAG(WriteMonoDepthSpan);
rb->PutValues = TAG(WriteDepthPixels);
- rb->PutMonoValues = NULL;
}
diff --git a/src/mesa/drivers/dri/common/spantmp2.h b/src/mesa/drivers/dri/common/spantmp2.h
index 83cfbb16409..6030ca18a7e 100644
--- a/src/mesa/drivers/dri/common/spantmp2.h
+++ b/src/mesa/drivers/dri/common/spantmp2.h
@@ -63,9 +63,6 @@
#define PUT_VALUE(_x, _y, _v) *(volatile GLushort *)(GET_PTR(_x, _y)) = (_v)
#endif /* GET_VALUE */
-#define INIT_MONO_PIXEL(p, color) \
- p = PACK_COLOR_565( color[0], color[1], color[2] )
-
#define WRITE_RGBA( _x, _y, r, g, b, a ) \
PUT_VALUE(_x, _y, ((((int)r & 0xf8) << 8) | \
(((int)g & 0xfc) << 3) | \
@@ -97,9 +94,6 @@
#define PUT_VALUE(_x, _y, _v) *(volatile GLushort *)(GET_PTR(_x, _y)) = (_v)
#endif /* GET_VALUE */
-#define INIT_MONO_PIXEL(p, color) \
- p = PACK_COLOR_565_REV( color[0], color[1], color[2] )
-
#define WRITE_RGBA( _x, _y, r, g, b, a ) \
PUT_VALUE(_x, _y, PACK_COLOR_565_REV( r, g, b ))
@@ -130,9 +124,6 @@
#define PUT_VALUE(_x, _y, _v) *(volatile GLushort *)(GET_PTR(_x, _y)) = (_v)
#endif /* GET_VALUE */
-#define INIT_MONO_PIXEL(p, color) \
- p = PACK_COLOR_4444_REV(color[3], color[0], color[1], color[2])
-
#define WRITE_RGBA( _x, _y, r, g, b, a ) \
PUT_VALUE(_x, _y, PACK_COLOR_4444_REV(a, r, g, b)) \
@@ -163,9 +154,6 @@
#define PUT_VALUE(_x, _y, _v) *(volatile GLushort *)(GET_PTR(_x, _y)) = (_v)
#endif /* GET_VALUE */
-#define INIT_MONO_PIXEL(p, color) \
- p = PACK_COLOR_4444(color[3], color[0], color[1], color[2])
-
#define WRITE_RGBA( _x, _y, r, g, b, a ) \
PUT_VALUE(_x, _y, PACK_COLOR_4444(a, r, g, b)) \
@@ -196,9 +184,6 @@
#define PUT_VALUE(_x, _y, _v) *(volatile GLushort *)(GET_PTR(_x, _y)) = (_v)
#endif /* GET_VALUE */
-#define INIT_MONO_PIXEL(p, color) \
- p = PACK_COLOR_1555(color[3], color[0], color[1], color[2])
-
#define WRITE_RGBA( _x, _y, r, g, b, a ) \
PUT_VALUE(_x, _y, PACK_COLOR_1555(a, r, g, b)) \
@@ -228,9 +213,6 @@
#define PUT_VALUE(_x, _y, _v) *(volatile GLushort *)(GET_PTR(_x, _y)) = (_v)
#endif /* GET_VALUE */
-#define INIT_MONO_PIXEL(p, color) \
- p = PACK_COLOR_1555_REV(color[3], color[0], color[1], color[2])
-
#define WRITE_RGBA( _x, _y, r, g, b, a ) \
PUT_VALUE(_x, _y, PACK_COLOR_1555_REV(a, r, g, b)) \
@@ -261,9 +243,6 @@
#define PUT_VALUE(_x, _y, _v) *(volatile GLuint *)(GET_PTR(_x, _y)) = (_v)
#endif /* GET_VALUE */
-# define INIT_MONO_PIXEL(p, color) \
- p = PACK_COLOR_8888(color[3], color[0], color[1], color[2])
-
# define WRITE_RGBA(_x, _y, r, g, b, a) \
PUT_VALUE(_x, _y, ((r << 16) | \
(g << 8) | \
@@ -316,9 +295,6 @@
#define PUT_VALUE(_x, _y, _v) *(volatile GLuint *)(GET_PTR(_x, _y)) = (_v)
#endif /* GET_VALUE */
-# define INIT_MONO_PIXEL(p, color) \
- p = PACK_COLOR_8888(color[2], color[1], color[0], color[3])
-
# define WRITE_RGBA(_x, _y, r, g, b, a) \
PUT_VALUE(_x, _y, ((r << 8) | \
(g << 16) | \
@@ -374,9 +350,6 @@
#define PUT_VALUE(_x, _y, _v) *(volatile GLuint *)(GET_PTR(_x, _y)) = (_v)
#endif /* GET_VALUE */
-# define INIT_MONO_PIXEL(p, color) \
- p = PACK_COLOR_8888(0xff, color[0], color[1], color[2])
-
# define WRITE_RGBA(_x, _y, r, g, b, a) \
PUT_VALUE(_x, _y, ((r << 16) | \
(g << 8) | \
@@ -428,9 +401,6 @@
#define PUT_VALUE(_x, _y, _v) *(volatile GLubyte *)(GET_PTR(_x, _y)) = (_v)
#endif /* GET_VALUE */
-# define INIT_MONO_PIXEL(p, color) \
- p = color[3]
-
# define WRITE_RGBA(_x, _y, r, g, b, a) \
PUT_VALUE(_x, _y, a | (r & 0 /* quiet warnings */))
@@ -594,91 +564,6 @@ static void TAG(WriteRGBAPixels)( struct gl_context *ctx,
}
-static void TAG(WriteMonoRGBASpan)( struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- const void *value, const GLubyte mask[] )
-{
- (void) ctx;
-
- HW_WRITE_LOCK()
- {
- const GLubyte *color = (const GLubyte *) value;
- GLint x1;
- GLint n1;
- LOCAL_VARS;
- INIT_MONO_PIXEL(p, color);
-
- y = Y_FLIP( y );
-
- if (DBG) fprintf(stderr, "WriteMonoRGBASpan\n");
-
- HW_WRITE_CLIPLOOP()
- {
- GLint i = 0;
- CLIPSPAN(x,y,n,x1,n1,i);
- if (mask)
- {
- for (;n1>0;i++,x1++,n1--)
- if (mask[i])
- WRITE_PIXEL( x1, y, p );
- }
- else
- {
- for (;n1>0;i++,x1++,n1--)
- WRITE_PIXEL( x1, y, p );
- }
- }
- HW_ENDCLIPLOOP();
- }
- HW_WRITE_UNLOCK();
-}
-
-
-static void TAG(WriteMonoRGBAPixels)( struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n,
- const GLint x[], const GLint y[],
- const void *value,
- const GLubyte mask[] )
-{
- (void) ctx;
-
- HW_WRITE_LOCK()
- {
- const GLubyte *color = (const GLubyte *) value;
- GLint i;
- LOCAL_VARS;
- INIT_MONO_PIXEL(p, color);
-
- if (DBG) fprintf(stderr, "WriteMonoRGBAPixels\n");
-
- HW_WRITE_CLIPLOOP()
- {
- if (mask)
- {
- for (i=0;i<n;i++)
- if (mask[i]) {
- int fy = Y_FLIP(y[i]);
- if (CLIPPIXEL( x[i], fy ))
- WRITE_PIXEL( x[i], fy, p );
- }
- }
- else
- {
- for (i=0;i<n;i++) {
- int fy = Y_FLIP(y[i]);
- if (CLIPPIXEL( x[i], fy ))
- WRITE_PIXEL( x[i], fy, p );
- }
- }
- }
- HW_ENDCLIPLOOP();
- }
- HW_WRITE_UNLOCK();
-}
-
-
static void TAG(ReadRGBASpan)( struct gl_context *ctx,
struct gl_renderbuffer *rb,
GLuint n, GLint x, GLint y, void *values)
@@ -879,9 +764,7 @@ static void TAG(InitPointers)(struct gl_renderbuffer *rb)
{
rb->PutRow = TAG(WriteRGBASpan);
rb->PutRowRGB = TAG(WriteRGBSpan);
- rb->PutMonoRow = TAG(WriteMonoRGBASpan);
rb->PutValues = TAG(WriteRGBAPixels);
- rb->PutMonoValues = TAG(WriteMonoRGBAPixels);
rb->GetValues = TAG(ReadRGBAPixels);
#if defined(GET_PTR)
@@ -923,7 +806,6 @@ static void TAG(InitPointers)(struct gl_renderbuffer *rb)
}
-#undef INIT_MONO_PIXEL
#undef WRITE_PIXEL
#undef WRITE_RGBA
#undef READ_RGBA
diff --git a/src/mesa/drivers/dri/common/stenciltmp.h b/src/mesa/drivers/dri/common/stenciltmp.h
index fef09720895..e4e39c73034 100644
--- a/src/mesa/drivers/dri/common/stenciltmp.h
+++ b/src/mesa/drivers/dri/common/stenciltmp.h
@@ -61,62 +61,6 @@ static void TAG(WriteStencilSpan)( struct gl_context *ctx,
HW_WRITE_UNLOCK();
}
-#if HAVE_HW_STENCIL_SPANS
-/* implement MonoWriteDepthSpan() in terms of WriteDepthSpan() */
-static void
-TAG(WriteMonoStencilSpan)( struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- const void *value, const GLubyte mask[] )
-{
- const GLuint stenVal = *((GLuint *) value);
- GLuint stens[MAX_WIDTH];
- GLuint i;
- for (i = 0; i < n; i++)
- stens[i] = stenVal;
- TAG(WriteStencilSpan)(ctx, rb, n, x, y, stens, mask);
-}
-#else /* HAVE_HW_STENCIL_SPANS */
-static void TAG(WriteMonoStencilSpan)( struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- const void *value,
- const GLubyte mask[] )
-{
- HW_WRITE_LOCK()
- {
- const GLubyte stencil = *((const GLubyte *) value);
- GLint x1;
- GLint n1;
- LOCAL_STENCIL_VARS;
-
- y = Y_FLIP(y);
-
- HW_CLIPLOOP()
- {
- GLint i = 0;
- CLIPSPAN(x,y,n,x1,n1,i);
-
- if (DBG) fprintf(stderr, "WriteStencilSpan %d..%d (x1 %d)\n",
- (int)i, (int)n1, (int)x1);
-
- if (mask)
- {
- for (;n1>0;i++,x1++,n1--)
- if (mask[i])
- WRITE_STENCIL( x1, y, stencil );
- }
- else
- {
- for (;n1>0;i++,x1++,n1--)
- WRITE_STENCIL( x1, y, stencil );
- }
- }
- HW_ENDCLIPLOOP();
- }
- HW_WRITE_UNLOCK();
-}
-#endif /* !HAVE_HW_STENCIL_SPANS */
-
static void TAG(WriteStencilPixels)( struct gl_context *ctx,
struct gl_renderbuffer *rb,
@@ -234,9 +178,7 @@ static void TAG(InitStencilPointers)(struct gl_renderbuffer *rb)
rb->GetValues = TAG(ReadStencilPixels);
rb->PutRow = TAG(WriteStencilSpan);
rb->PutRowRGB = NULL;
- rb->PutMonoRow = TAG(WriteMonoStencilSpan);
rb->PutValues = TAG(WriteStencilPixels);
- rb->PutMonoValues = NULL;
}
diff --git a/src/mesa/drivers/dri/swrast/swrast_span.c b/src/mesa/drivers/dri/swrast/swrast_span.c
index 772d09f5ae6..35993fa36db 100644
--- a/src/mesa/drivers/dri/swrast/swrast_span.c
+++ b/src/mesa/drivers/dri/swrast/swrast_span.c
@@ -277,36 +277,28 @@ swrast_set_span_funcs_back(struct swrast_renderbuffer *xrb,
xrb->Base.GetValues = get_values_A8R8G8B8;
xrb->Base.PutRow = put_row_A8R8G8B8;
xrb->Base.PutRowRGB = put_row_rgb_A8R8G8B8;
- xrb->Base.PutMonoRow = put_mono_row_A8R8G8B8;
xrb->Base.PutValues = put_values_A8R8G8B8;
- xrb->Base.PutMonoValues = put_mono_values_A8R8G8B8;
break;
case PF_X8R8G8B8:
xrb->Base.GetRow = get_row_X8R8G8B8;
xrb->Base.GetValues = get_values_X8R8G8B8;
xrb->Base.PutRow = put_row_X8R8G8B8;
xrb->Base.PutRowRGB = put_row_rgb_X8R8G8B8;
- xrb->Base.PutMonoRow = put_mono_row_X8R8G8B8;
xrb->Base.PutValues = put_values_X8R8G8B8;
- xrb->Base.PutMonoValues = put_mono_values_X8R8G8B8;
break;
case PF_R5G6B5:
xrb->Base.GetRow = get_row_R5G6B5;
xrb->Base.GetValues = get_values_R5G6B5;
xrb->Base.PutRow = put_row_R5G6B5;
xrb->Base.PutRowRGB = put_row_rgb_R5G6B5;
- xrb->Base.PutMonoRow = put_mono_row_R5G6B5;
xrb->Base.PutValues = put_values_R5G6B5;
- xrb->Base.PutMonoValues = put_mono_values_R5G6B5;
break;
case PF_R3G3B2:
xrb->Base.GetRow = get_row_R3G3B2;
xrb->Base.GetValues = get_values_R3G3B2;
xrb->Base.PutRow = put_row_R3G3B2;
xrb->Base.PutRowRGB = put_row_rgb_R3G3B2;
- xrb->Base.PutMonoRow = put_mono_row_R3G3B2;
xrb->Base.PutValues = put_values_R3G3B2;
- xrb->Base.PutMonoValues = put_mono_values_R3G3B2;
break;
default:
assert(0);
@@ -333,36 +325,28 @@ swrast_set_span_funcs_front(struct swrast_renderbuffer *xrb,
xrb->Base.GetValues = get_values_A8R8G8B8_front;
xrb->Base.PutRow = put_row_A8R8G8B8_front;
xrb->Base.PutRowRGB = put_row_rgb_A8R8G8B8_front;
- xrb->Base.PutMonoRow = put_mono_row_A8R8G8B8_front;
xrb->Base.PutValues = put_values_A8R8G8B8_front;
- xrb->Base.PutMonoValues = put_mono_values_A8R8G8B8_front;
break;
case PF_X8R8G8B8:
xrb->Base.GetRow = get_row_X8R8G8B8_front;
xrb->Base.GetValues = get_values_X8R8G8B8_front;
xrb->Base.PutRow = put_row_X8R8G8B8_front;
xrb->Base.PutRowRGB = put_row_rgb_X8R8G8B8_front;
- xrb->Base.PutMonoRow = put_mono_row_X8R8G8B8_front;
xrb->Base.PutValues = put_values_X8R8G8B8_front;
- xrb->Base.PutMonoValues = put_mono_values_X8R8G8B8_front;
break;
case PF_R5G6B5:
xrb->Base.GetRow = get_row_R5G6B5_front;
xrb->Base.GetValues = get_values_R5G6B5_front;
xrb->Base.PutRow = put_row_R5G6B5_front;
xrb->Base.PutRowRGB = put_row_rgb_R5G6B5_front;
- xrb->Base.PutMonoRow = put_mono_row_R5G6B5_front;
xrb->Base.PutValues = put_values_R5G6B5_front;
- xrb->Base.PutMonoValues = put_mono_values_R5G6B5_front;
break;
case PF_R3G3B2:
xrb->Base.GetRow = get_row_R3G3B2_front;
xrb->Base.GetValues = get_values_R3G3B2_front;
xrb->Base.PutRow = put_row_R3G3B2_front;
xrb->Base.PutRowRGB = put_row_rgb_R3G3B2_front;
- xrb->Base.PutMonoRow = put_mono_row_R3G3B2_front;
xrb->Base.PutValues = put_values_R3G3B2_front;
- xrb->Base.PutMonoValues = put_mono_values_R3G3B2_front;
break;
default:
assert(0);
diff --git a/src/mesa/drivers/dri/swrast/swrast_spantemp.h b/src/mesa/drivers/dri/swrast/swrast_spantemp.h
index 69f8d9f2404..892a771b7f6 100644
--- a/src/mesa/drivers/dri/swrast/swrast_spantemp.h
+++ b/src/mesa/drivers/dri/swrast/swrast_spantemp.h
@@ -92,8 +92,7 @@ GET_ROW( struct gl_context *glCtx, GLint x, GLint y, GLuint n, char *row )
/*
* Templates for the span/pixel-array write/read functions called via
- * the gl_renderbuffer's GetRow, GetValues, PutRow, PutMonoRow, PutValues
- * and PutMonoValues functions.
+ * the gl_renderbuffer's GetRow, GetValues, PutRow and PutValues.
*
* Define the following macros before including this file:
* NAME(BASE) to generate the function name (i.e. add prefix or suffix)
@@ -230,39 +229,6 @@ NAME(put_row_rgb)( struct gl_context *ctx, struct gl_renderbuffer *rb,
static void
-NAME(put_mono_row)( struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLuint count, GLint x, GLint y,
- const void *value, const GLubyte mask[] )
-{
-#ifdef SPAN_VARS
- SPAN_VARS
-#endif
- const RB_TYPE *src = (const RB_TYPE *) value;
- GLuint i;
- if (mask) {
- for (i = 0; i < count; i++) {
- if (mask[i]) {
- RB_TYPE row[4];
- INIT_PIXEL_PTR(pixel, x, y);
- STORE_PIXEL(pixel, x + i, y, src);
- PUT_PIXEL(ctx, x + i, YFLIP(xrb, y), pixel);
- }
- }
- }
- else {
- char *row = swrast_drawable(ctx->DrawBuffer)->row;
- INIT_PIXEL_PTR(pixel, x, y);
- for (i = 0; i < count; i++) {
- STORE_PIXEL(pixel, x + i, y, src);
- INC_PIXEL_PTR(pixel);
- }
- PUT_ROW( ctx, x, YFLIP(xrb, y), count, row );
- }
- (void) rb;
-}
-
-
-static void
NAME(put_values)( struct gl_context *ctx, struct gl_renderbuffer *rb,
GLuint count, const GLint x[], const GLint y[],
const void *values, const GLubyte mask[] )
@@ -285,27 +251,6 @@ NAME(put_values)( struct gl_context *ctx, struct gl_renderbuffer *rb,
}
-static void
-NAME(put_mono_values)( struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLuint count, const GLint x[], const GLint y[],
- const void *value, const GLubyte mask[] )
-{
-#ifdef SPAN_VARS
- SPAN_VARS
-#endif
- const RB_TYPE *src = (const RB_TYPE *) value;
- GLuint i;
- ASSERT(mask);
- for (i = 0; i < count; i++) {
- if (mask[i]) {
- RB_TYPE row[4];
- INIT_PIXEL_PTR(pixel, x, y);
- STORE_PIXEL(pixel, x[i], y[i], src);
- PUT_PIXEL(ctx, x[i], YFLIP(xrb, y[i]), pixel);
- }
- }
- (void) rb;
-}
#undef NAME