diff options
author | Brian Paul <[email protected]> | 2011-12-24 08:54:26 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2011-12-24 08:54:26 -0700 |
commit | fc41473b9f7d1171a2921a825807889b8fcbcaaf (patch) | |
tree | 436f32a8177ad21b34660d14023312a8a02380bd /src/mesa/drivers | |
parent | c4b5f0cadb18bad22b4c28424723a09832209c6f (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')
-rw-r--r-- | src/mesa/drivers/dri/common/depthtmp.h | 59 | ||||
-rw-r--r-- | src/mesa/drivers/dri/common/spantmp2.h | 118 | ||||
-rw-r--r-- | src/mesa/drivers/dri/common/stenciltmp.h | 58 | ||||
-rw-r--r-- | src/mesa/drivers/dri/swrast/swrast_span.c | 16 | ||||
-rw-r--r-- | src/mesa/drivers/dri/swrast/swrast_spantemp.h | 57 | ||||
-rw-r--r-- | src/mesa/drivers/osmesa/osmesa.c | 32 | ||||
-rw-r--r-- | src/mesa/drivers/windows/gdi/wmesa.c | 215 | ||||
-rw-r--r-- | src/mesa/drivers/x11/xm_span.c | 451 |
8 files changed, 7 insertions, 999 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 diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c index 0e062f4fe60..988d447ace2 100644 --- a/src/mesa/drivers/osmesa/osmesa.c +++ b/src/mesa/drivers/osmesa/osmesa.c @@ -806,27 +806,21 @@ osmesa_renderbuffer_storage(struct gl_context *ctx, struct gl_renderbuffer *rb, rb->GetValues = get_values_RGBA8; rb->PutRow = put_row_RGBA8; rb->PutRowRGB = put_row_rgb_RGBA8; - rb->PutMonoRow = put_mono_row_RGBA8; rb->PutValues = put_values_RGBA8; - rb->PutMonoValues = put_mono_values_RGBA8; } else if (rb->DataType == GL_UNSIGNED_SHORT) { rb->GetRow = get_row_RGBA16; rb->GetValues = get_values_RGBA16; rb->PutRow = put_row_RGBA16; rb->PutRowRGB = put_row_rgb_RGBA16; - rb->PutMonoRow = put_mono_row_RGBA16; rb->PutValues = put_values_RGBA16; - rb->PutMonoValues = put_mono_values_RGBA16; } else { rb->GetRow = get_row_RGBA32; rb->GetValues = get_values_RGBA32; rb->PutRow = put_row_RGBA32; rb->PutRowRGB = put_row_rgb_RGBA32; - rb->PutMonoRow = put_mono_row_RGBA32; rb->PutValues = put_values_RGBA32; - rb->PutMonoValues = put_mono_values_RGBA32; } } else if (osmesa->format == OSMESA_BGRA) { @@ -835,27 +829,21 @@ osmesa_renderbuffer_storage(struct gl_context *ctx, struct gl_renderbuffer *rb, rb->GetValues = get_values_BGRA8; rb->PutRow = put_row_BGRA8; rb->PutRowRGB = put_row_rgb_BGRA8; - rb->PutMonoRow = put_mono_row_BGRA8; rb->PutValues = put_values_BGRA8; - rb->PutMonoValues = put_mono_values_BGRA8; } else if (rb->DataType == GL_UNSIGNED_SHORT) { rb->GetRow = get_row_BGRA16; rb->GetValues = get_values_BGRA16; rb->PutRow = put_row_BGRA16; rb->PutRowRGB = put_row_rgb_BGRA16; - rb->PutMonoRow = put_mono_row_BGRA16; rb->PutValues = put_values_BGRA16; - rb->PutMonoValues = put_mono_values_BGRA16; } else { rb->GetRow = get_row_BGRA32; rb->GetValues = get_values_BGRA32; rb->PutRow = put_row_BGRA32; rb->PutRowRGB = put_row_rgb_BGRA32; - rb->PutMonoRow = put_mono_row_BGRA32; rb->PutValues = put_values_BGRA32; - rb->PutMonoValues = put_mono_values_BGRA32; } } else if (osmesa->format == OSMESA_ARGB) { @@ -864,27 +852,21 @@ osmesa_renderbuffer_storage(struct gl_context *ctx, struct gl_renderbuffer *rb, rb->GetValues = get_values_ARGB8; rb->PutRow = put_row_ARGB8; rb->PutRowRGB = put_row_rgb_ARGB8; - rb->PutMonoRow = put_mono_row_ARGB8; rb->PutValues = put_values_ARGB8; - rb->PutMonoValues = put_mono_values_ARGB8; } else if (rb->DataType == GL_UNSIGNED_SHORT) { rb->GetRow = get_row_ARGB16; rb->GetValues = get_values_ARGB16; rb->PutRow = put_row_ARGB16; rb->PutRowRGB = put_row_rgb_ARGB16; - rb->PutMonoRow = put_mono_row_ARGB16; rb->PutValues = put_values_ARGB16; - rb->PutMonoValues = put_mono_values_ARGB16; } else { rb->GetRow = get_row_ARGB32; rb->GetValues = get_values_ARGB32; rb->PutRow = put_row_ARGB32; rb->PutRowRGB = put_row_rgb_ARGB32; - rb->PutMonoRow = put_mono_row_ARGB32; rb->PutValues = put_values_ARGB32; - rb->PutMonoValues = put_mono_values_ARGB32; } } else if (osmesa->format == OSMESA_RGB) { @@ -893,27 +875,21 @@ osmesa_renderbuffer_storage(struct gl_context *ctx, struct gl_renderbuffer *rb, rb->GetValues = get_values_RGB8; rb->PutRow = put_row_RGB8; rb->PutRowRGB = put_row_rgb_RGB8; - rb->PutMonoRow = put_mono_row_RGB8; rb->PutValues = put_values_RGB8; - rb->PutMonoValues = put_mono_values_RGB8; } else if (rb->DataType == GL_UNSIGNED_SHORT) { rb->GetRow = get_row_RGB16; rb->GetValues = get_values_RGB16; rb->PutRow = put_row_RGB16; rb->PutRowRGB = put_row_rgb_RGB16; - rb->PutMonoRow = put_mono_row_RGB16; rb->PutValues = put_values_RGB16; - rb->PutMonoValues = put_mono_values_RGB16; } else { rb->GetRow = get_row_RGB32; rb->GetValues = get_values_RGB32; rb->PutRow = put_row_RGB32; rb->PutRowRGB = put_row_rgb_RGB32; - rb->PutMonoRow = put_mono_row_RGB32; rb->PutValues = put_values_RGB32; - rb->PutMonoValues = put_mono_values_RGB32; } } else if (osmesa->format == OSMESA_BGR) { @@ -922,27 +898,21 @@ osmesa_renderbuffer_storage(struct gl_context *ctx, struct gl_renderbuffer *rb, rb->GetValues = get_values_BGR8; rb->PutRow = put_row_BGR8; rb->PutRowRGB = put_row_rgb_BGR8; - rb->PutMonoRow = put_mono_row_BGR8; rb->PutValues = put_values_BGR8; - rb->PutMonoValues = put_mono_values_BGR8; } else if (rb->DataType == GL_UNSIGNED_SHORT) { rb->GetRow = get_row_BGR16; rb->GetValues = get_values_BGR16; rb->PutRow = put_row_BGR16; rb->PutRowRGB = put_row_rgb_BGR16; - rb->PutMonoRow = put_mono_row_BGR16; rb->PutValues = put_values_BGR16; - rb->PutMonoValues = put_mono_values_BGR16; } else { rb->GetRow = get_row_BGR32; rb->GetValues = get_values_BGR32; rb->PutRow = put_row_BGR32; rb->PutRowRGB = put_row_rgb_BGR32; - rb->PutMonoRow = put_mono_row_BGR32; rb->PutValues = put_values_BGR32; - rb->PutMonoValues = put_mono_values_BGR32; } } else if (osmesa->format == OSMESA_RGB_565) { @@ -951,9 +921,7 @@ osmesa_renderbuffer_storage(struct gl_context *ctx, struct gl_renderbuffer *rb, rb->GetValues = get_values_RGB_565; rb->PutRow = put_row_RGB_565; rb->PutRowRGB = put_row_rgb_RGB_565; - rb->PutMonoRow = put_mono_row_RGB_565; rb->PutValues = put_values_RGB_565; - rb->PutMonoValues = put_mono_values_RGB_565; } else { _mesa_problem(ctx, "bad pixel format in osmesa renderbuffer_storage"); diff --git a/src/mesa/drivers/windows/gdi/wmesa.c b/src/mesa/drivers/windows/gdi/wmesa.c index 675ffdaaa92..427d2722215 100644 --- a/src/mesa/drivers/windows/gdi/wmesa.c +++ b/src/mesa/drivers/windows/gdi/wmesa.c @@ -553,34 +553,6 @@ static void write_rgb_span_front(struct gl_context *ctx, } -/* - * Write a horizontal span of pixels with a boolean mask. The current color - * is used for all pixels. - */ -static void write_mono_rgba_span_front(struct gl_context *ctx, - struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, - const void *value, - const GLubyte *mask) -{ - const GLchan *color = (const GLchan *)value; - GLuint i; - WMesaContext pwc = wmesa_context(ctx); - COLORREF colorref; - - (void) ctx; - colorref = RGB(color[RCOMP], color[GCOMP], color[BCOMP]); - y=FLIP(y); - if (mask) { - for (i=0; i<n; i++) - if (mask[i]) - SetPixel(pwc->hDC, x+i, y, colorref); - } - else - for (i=0; i<n; i++) - SetPixel(pwc->hDC, x+i, y, colorref); - -} /* Write an array of RGBA pixels with a boolean mask. */ static void write_rgba_pixels_front(struct gl_context *ctx, @@ -603,28 +575,6 @@ static void write_rgba_pixels_front(struct gl_context *ctx, -/* - * Write an array of pixels with a boolean mask. The current color - * is used for all pixels. - */ -static void write_mono_rgba_pixels_front(struct gl_context *ctx, - struct gl_renderbuffer *rb, - GLuint n, - const GLint x[], const GLint y[], - const void *value, - const GLubyte *mask) -{ - const GLchan *color = (const GLchan *)value; - GLuint i; - WMesaContext pwc = wmesa_context(ctx); - COLORREF colorref; - (void) ctx; - colorref = RGB(color[RCOMP], color[GCOMP], color[BCOMP]); - for (i=0; i<n; i++) - if (mask[i]) - SetPixel(pwc->hDC, x[i], FLIP(y[i]), colorref); -} - /* Read a horizontal span of color pixels. */ static void read_rgba_span_front(struct gl_context *ctx, struct gl_renderbuffer *rb, @@ -735,35 +685,6 @@ static void write_rgb_span_32(struct gl_context *ctx, } } -/* - * Write a horizontal span of pixels with a boolean mask. The current color - * is used for all pixels. - */ -static void write_mono_rgba_span_32(struct gl_context *ctx, - struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, - const void *value, - const GLubyte *mask) -{ - const GLchan *color = (const GLchan *)value; - LPDWORD lpdw; - DWORD pixel; - GLuint i; - WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); - lpdw = ((LPDWORD)(pwfb->pbPixels + pwfb->ScanWidth * y)) + x; - y=FLIP(y); - pixel = BGR32(color[RCOMP], color[GCOMP], color[BCOMP]); - if (mask) { - for (i=0; i<n; i++) - if (mask[i]) - lpdw[i] = pixel; - } - else - for (i=0; i<n; i++) - *lpdw++ = pixel; - -} - /* Write an array of RGBA pixels with a boolean mask. */ static void write_rgba_pixels_32(struct gl_context *ctx, struct gl_renderbuffer *rb, @@ -780,25 +701,6 @@ static void write_rgba_pixels_32(struct gl_context *ctx, rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]); } -/* - * Write an array of pixels with a boolean mask. The current color - * is used for all pixels. - */ -static void write_mono_rgba_pixels_32(struct gl_context *ctx, - struct gl_renderbuffer *rb, - GLuint n, - const GLint x[], const GLint y[], - const void *value, - const GLubyte *mask) -{ - const GLchan *color = (const GLchan *)value; - GLuint i; - WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); - for (i=0; i<n; i++) - if (mask[i]) - WMSETPIXEL32(pwfb, FLIP(y[i]),x[i],color[RCOMP], - color[GCOMP], color[BCOMP]); -} /* Read a horizontal span of color pixels. */ static void read_rgba_span_32(struct gl_context *ctx, @@ -925,37 +827,6 @@ static void write_rgb_span_24(struct gl_context *ctx, } } -/* - * Write a horizontal span of pixels with a boolean mask. The current color - * is used for all pixels. - */ -static void write_mono_rgba_span_24(struct gl_context *ctx, - struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, - const void *value, - const GLubyte *mask) -{ - const GLchan *color = (const GLchan *)value; - LPBYTE lpb; - GLuint i; - WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); - lpb = ((LPBYTE)(pwfb->pbPixels + pwfb->ScanWidth * y)) + (3 * x); - y=FLIP(y); - if (mask) { - for (i=0; i<n; i++) - if (mask[i]) { - lpb[3*i] = color[BCOMP]; - lpb[3*i+1] = color[GCOMP]; - lpb[3*i+2] = color[RCOMP]; - } - } - else - for (i=0; i<n; i++) { - *lpb++ = color[BCOMP]; - *lpb++ = color[GCOMP]; - *lpb++ = color[RCOMP]; - } -} /* Write an array of RGBA pixels with a boolean mask. */ static void write_rgba_pixels_24(struct gl_context *ctx, @@ -973,25 +844,6 @@ static void write_rgba_pixels_24(struct gl_context *ctx, rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]); } -/* - * Write an array of pixels with a boolean mask. The current color - * is used for all pixels. - */ -static void write_mono_rgba_pixels_24(struct gl_context *ctx, - struct gl_renderbuffer *rb, - GLuint n, - const GLint x[], const GLint y[], - const void *value, - const GLubyte *mask) -{ - const GLchan *color = (const GLchan *)value; - GLuint i; - WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); - for (i=0; i<n; i++) - if (mask[i]) - WMSETPIXEL24(pwfb, FLIP(y[i]),x[i],color[RCOMP], - color[GCOMP], color[BCOMP]); -} /* Read a horizontal span of color pixels. */ static void read_rgba_span_24(struct gl_context *ctx, @@ -1106,35 +958,6 @@ static void write_rgb_span_16(struct gl_context *ctx, } } -/* - * Write a horizontal span of pixels with a boolean mask. The current color - * is used for all pixels. - */ -static void write_mono_rgba_span_16(struct gl_context *ctx, - struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, - const void *value, - const GLubyte *mask) -{ - const GLchan *color = (const GLchan *)value; - LPWORD lpw; - WORD pixel; - GLuint i; - WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); - (void) ctx; - lpw = ((LPWORD)(pwfb->pbPixels + pwfb->ScanWidth * y)) + x; - y=FLIP(y); - pixel = BGR16(color[RCOMP], color[GCOMP], color[BCOMP]); - if (mask) { - for (i=0; i<n; i++) - if (mask[i]) - lpw[i] = pixel; - } - else - for (i=0; i<n; i++) - *lpw++ = pixel; - -} /* Write an array of RGBA pixels with a boolean mask. */ static void write_rgba_pixels_16(struct gl_context *ctx, @@ -1153,26 +976,6 @@ static void write_rgba_pixels_16(struct gl_context *ctx, rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]); } -/* - * Write an array of pixels with a boolean mask. The current color - * is used for all pixels. - */ -static void write_mono_rgba_pixels_16(struct gl_context *ctx, - struct gl_renderbuffer *rb, - GLuint n, - const GLint x[], const GLint y[], - const void *value, - const GLubyte *mask) -{ - const GLchan *color = (const GLchan *)value; - GLuint i; - WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); - (void) ctx; - for (i=0; i<n; i++) - if (mask[i]) - WMSETPIXEL16(pwfb, FLIP(y[i]),x[i],color[RCOMP], - color[GCOMP], color[BCOMP]); -} /* Read a horizontal span of color pixels. */ static void read_rgba_span_16(struct gl_context *ctx, @@ -1271,9 +1074,7 @@ wmesa_set_renderbuffer_funcs(struct gl_renderbuffer *rb, int pixelformat, case PF_5R6G5B: rb->PutRow = write_rgba_span_16; rb->PutRowRGB = write_rgb_span_16; - rb->PutMonoRow = write_mono_rgba_span_16; rb->PutValues = write_rgba_pixels_16; - rb->PutMonoValues = write_mono_rgba_pixels_16; rb->GetRow = read_rgba_span_16; rb->GetValues = read_rgba_pixels_16; break; @@ -1282,21 +1083,17 @@ wmesa_set_renderbuffer_funcs(struct gl_renderbuffer *rb, int pixelformat, { rb->PutRow = write_rgba_span_24; rb->PutRowRGB = write_rgb_span_24; - rb->PutMonoRow = write_mono_rgba_span_24; rb->PutValues = write_rgba_pixels_24; - rb->PutMonoValues = write_mono_rgba_pixels_24; rb->GetRow = read_rgba_span_24; rb->GetValues = read_rgba_pixels_24; } else { - rb->PutRow = write_rgba_span_32; - rb->PutRowRGB = write_rgb_span_32; - rb->PutMonoRow = write_mono_rgba_span_32; - rb->PutValues = write_rgba_pixels_32; - rb->PutMonoValues = write_mono_rgba_pixels_32; - rb->GetRow = read_rgba_span_32; - rb->GetValues = read_rgba_pixels_32; + rb->PutRow = write_rgba_span_32; + rb->PutRowRGB = write_rgb_span_32; + rb->PutValues = write_rgba_pixels_32; + rb->GetRow = read_rgba_span_32; + rb->GetValues = read_rgba_pixels_32; } break; default: @@ -1307,9 +1104,7 @@ wmesa_set_renderbuffer_funcs(struct gl_renderbuffer *rb, int pixelformat, /* front buffer (actual Windows window) */ rb->PutRow = write_rgba_span_front; rb->PutRowRGB = write_rgb_span_front; - rb->PutMonoRow = write_mono_rgba_span_front; rb->PutValues = write_rgba_pixels_front; - rb->PutMonoValues = write_mono_rgba_pixels_front; rb->GetRow = read_rgba_span_front; rb->GetValues = read_rgba_pixels_front; } diff --git a/src/mesa/drivers/x11/xm_span.c b/src/mesa/drivers/x11/xm_span.c index 2a14d530772..6a066485851 100644 --- a/src/mesa/drivers/x11/xm_span.c +++ b/src/mesa/drivers/x11/xm_span.c @@ -136,7 +136,7 @@ static unsigned long read_pixel( XMesaDisplay *dpy, * * The function naming convention is: * - * [put|get]_[mono]_[row|values]_[format]_[pixmap|ximage] + * [put|get]_[row|values]_[format]_[pixmap|ximage] * * New functions optimized for specific cases can be added without too much * trouble. An example might be the 24-bit TrueColor mode 8A8R8G8B which is @@ -1811,423 +1811,6 @@ static void put_values_DITHER_5R6G5B_ximage( PUT_VALUES_ARGS ) /**********************************************************************/ -/*** Write MONO COLOR SPAN functions ***/ -/**********************************************************************/ - -#define PUT_MONO_ROW_ARGS \ - struct gl_context *ctx, struct gl_renderbuffer *rb, \ - GLuint n, GLint x, GLint y, const void *value, \ - const GLubyte mask[] - - - -/* - * Write a span of identical pixels to a pixmap. - */ -static void put_mono_row_pixmap( PUT_MONO_ROW_ARGS ) -{ - const GLubyte *color = (const GLubyte *) value; - GET_XRB(xrb); - XMesaContext xmesa = XMESA_CONTEXT(ctx); - XMesaDisplay *dpy = xmesa->xm_visual->display; - XMesaDrawable buffer = xrb->drawable; - XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; - const unsigned long pixel = xmesa_color_to_pixel(ctx, color[RCOMP], - color[GCOMP], color[BCOMP], color[ACOMP], xmesa->pixelformat); - register GLuint i; - XMesaSetForeground( xmesa->display, gc, pixel ); - y = YFLIP(xrb, y); - - /* New code contributed by Jeff Epler and cleaned up by Keith - * Whitwell. - */ - for (i = 0; i < n; ) { - GLuint start = i; - - /* Identify and emit contiguous rendered pixels - */ - while (i < n && (!mask || mask[i])) - i++; - - if (start < i) - XMesaFillRectangle( dpy, buffer, gc, - (int)(x+start), (int) y, - (int)(i-start), 1); - - /* Eat up non-rendered pixels - */ - while (i < n && !mask[i]) - i++; - } -} - - - -/* - * Write a span of PF_TRUEDITHER pixels to a pixmap. - */ -static void put_mono_row_TRUEDITHER_pixmap( PUT_MONO_ROW_ARGS ) -{ - const GLubyte *color = (const GLubyte *) value; - GET_XRB(xrb); - XMesaContext xmesa = XMESA_CONTEXT(ctx); - XMesaDisplay *dpy = xmesa->xm_visual->display; - XMesaDrawable buffer = xrb->drawable; - XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; - const GLubyte r = color[RCOMP], g = color[GCOMP], b = color[BCOMP]; - register GLuint i; - int yy = YFLIP(xrb, y); - for (i=0;i<n;i++,x++) { - if (!mask || mask[i]) { - unsigned long p; - PACK_TRUEDITHER(p, x, yy, r, g, b); - XMesaSetForeground( dpy, gc, p ); - XMesaDrawPoint( dpy, buffer, gc, (int) x, (int) yy ); - } - } -} - - -/* - * Write a span of identical pixels to an XImage. - */ -static void put_mono_row_ximage( PUT_MONO_ROW_ARGS ) -{ - const GLubyte *color = (const GLubyte *) value; - GET_XRB(xrb); - XMesaContext xmesa = XMESA_CONTEXT(ctx); - XMesaImage *img = xrb->ximage; - register GLuint i; - const unsigned long pixel = xmesa_color_to_pixel(ctx, color[RCOMP], - color[GCOMP], color[BCOMP], color[ACOMP], xmesa->pixelformat); - y = YFLIP(xrb, y); - for (i=0;i<n;i++,x++) { - if (!mask || mask[i]) { - XMesaPutPixel( img, x, y, pixel ); - } - } -} - - -/* - * Write a span of identical PF_TRUEDITHER pixels to an XImage. - */ -static void put_mono_row_TRUEDITHER_ximage( PUT_MONO_ROW_ARGS ) -{ - const GLubyte *color = (const GLubyte *) value; - GET_XRB(xrb); - XMesaContext xmesa = XMESA_CONTEXT(ctx); - XMesaImage *img = xrb->ximage; - const GLint r = color[RCOMP], g = color[GCOMP], b = color[BCOMP]; - GLuint i; - y = YFLIP(xrb, y); - for (i=0;i<n;i++) { - if (!mask || mask[i]) { - unsigned long p; - PACK_TRUEDITHER( p, x+i, y, r, g, b); - XMesaPutPixel( img, x+i, y, p ); - } - } -} - - -/* - * Write a span of identical 8A8B8G8R pixels to an XImage. - */ -static void put_mono_row_8A8B8G8R_ximage( PUT_MONO_ROW_ARGS ) -{ - const GLubyte *color = (const GLubyte *) value; - GET_XRB(xrb); - XMesaContext xmesa = XMESA_CONTEXT(ctx); - GLuint i, *ptr; - const unsigned long pixel = xmesa_color_to_pixel(ctx, color[RCOMP], - color[GCOMP], color[BCOMP], color[ACOMP], xmesa->pixelformat); - ptr = PIXEL_ADDR4(xrb, x, y ); - for (i=0;i<n;i++) { - if (!mask || mask[i]) { - ptr[i] = pixel; - } - } -} - -/* - * Write a span of identical 8A8R8G8B pixels to an XImage. - */ -static void put_mono_row_8A8R8G8B_ximage( PUT_MONO_ROW_ARGS ) -{ - const GLubyte *color = (const GLubyte *) value; - GET_XRB(xrb); - GLuint i, *ptr; - XMesaContext xmesa = XMESA_CONTEXT(ctx); - const unsigned long pixel = xmesa_color_to_pixel(ctx, color[RCOMP], - color[GCOMP], color[BCOMP], color[ACOMP], xmesa->pixelformat); - ptr = PIXEL_ADDR4(xrb, x, y ); - for (i=0;i<n;i++) { - if (!mask || mask[i]) { - ptr[i] = pixel; - } - } -} - - -/* - * Write a span of identical 8R8G8B pixels to an XImage. - */ -static void put_mono_row_8R8G8B_ximage( PUT_MONO_ROW_ARGS ) -{ - const GLubyte *color = (const GLubyte *) value; - GET_XRB(xrb); - const GLuint pixel = PACK_8R8G8B(color[RCOMP], color[GCOMP], color[BCOMP]); - GLuint *ptr = PIXEL_ADDR4(xrb, x, y ); - GLuint i; - for (i=0;i<n;i++) { - if (!mask || mask[i]) { - ptr[i] = pixel; - } - } -} - - -/* - * Write a span of identical 8R8G8B pixels to an XImage. - */ -static void put_mono_row_8R8G8B24_ximage( PUT_MONO_ROW_ARGS ) -{ - const GLubyte *color = (const GLubyte *) value; - GET_XRB(xrb); - const GLubyte r = color[RCOMP]; - const GLubyte g = color[GCOMP]; - const GLubyte b = color[BCOMP]; - GLuint i; - bgr_t *ptr = PIXEL_ADDR3(xrb, x, y ); - for (i=0;i<n;i++) { - if (!mask || mask[i]) { - ptr[i].r = r; - ptr[i].g = g; - ptr[i].b = b; - } - } -} - - -/* - * Write a span of identical PF_DITHER_5R6G5B pixels to an XImage. - */ -static void put_mono_row_DITHER_5R6G5B_ximage( PUT_MONO_ROW_ARGS ) -{ - const GLubyte *color = (const GLubyte *) value; - GET_XRB(xrb); - const XMesaContext xmesa = XMESA_CONTEXT(ctx); - register GLushort *ptr = PIXEL_ADDR2(xrb, x, y ); - const GLint r = color[RCOMP], g = color[GCOMP], b = color[BCOMP]; - GLuint i; - y = YFLIP(xrb, y); - for (i=0;i<n;i++) { - if (!mask || mask[i]) { - PACK_TRUEDITHER(ptr[i], x+i, y, r, g, b); - } - } -} - - - -/**********************************************************************/ -/*** Write MONO COLOR PIXELS functions ***/ -/**********************************************************************/ - -#define PUT_MONO_VALUES_ARGS \ - struct gl_context *ctx, struct gl_renderbuffer *rb, \ - GLuint n, const GLint x[], const GLint y[], \ - const void *value, const GLubyte mask[] - - - -/* - * Write an array of identical pixels to a pixmap. - */ -static void put_mono_values_pixmap( PUT_MONO_VALUES_ARGS ) -{ - const GLubyte *color = (const GLubyte *) value; - const XMesaContext xmesa = XMESA_CONTEXT(ctx); - GET_XRB(xrb); - XMesaDisplay *dpy = xmesa->xm_visual->display; - XMesaDrawable buffer = xrb->drawable; - XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; - register GLuint i; - const unsigned long pixel = xmesa_color_to_pixel(ctx, color[RCOMP], - color[GCOMP], color[BCOMP], color[ACOMP], xmesa->pixelformat); - XMesaSetForeground( xmesa->display, gc, pixel ); - for (i=0;i<n;i++) { - if (mask[i]) { - XMesaDrawPoint( dpy, buffer, gc, - (int) x[i], (int) YFLIP(xrb, y[i]) ); - } - } -} - - -/* - * Write an array of PF_TRUEDITHER pixels to a pixmap. - */ -static void put_mono_values_TRUEDITHER_pixmap( PUT_MONO_VALUES_ARGS ) -{ - const GLubyte *color = (const GLubyte *) value; - const XMesaContext xmesa = XMESA_CONTEXT(ctx); - GET_XRB(xrb); - XMesaDisplay *dpy = xmesa->xm_visual->display; - XMesaDrawable buffer = xrb->drawable; - XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; - register GLuint i; - const GLubyte r = color[RCOMP], g = color[GCOMP], b = color[BCOMP]; - for (i=0;i<n;i++) { - if (mask[i]) { - unsigned long p; - PACK_TRUEDITHER(p, x[i], y[i], r, g, b); - XMesaSetForeground( dpy, gc, p ); - XMesaDrawPoint( dpy, buffer, gc, - (int) x[i], (int) YFLIP(xrb, y[i]) ); - } - } -} - - -/* - * Write an array of identical pixels to an XImage. - */ -static void put_mono_values_ximage( PUT_MONO_VALUES_ARGS ) -{ - const GLubyte *color = (const GLubyte *) value; - const XMesaContext xmesa = XMESA_CONTEXT(ctx); - GET_XRB(xrb); - XMesaImage *img = xrb->ximage; - register GLuint i; - const unsigned long pixel = xmesa_color_to_pixel(ctx, color[RCOMP], - color[GCOMP], color[BCOMP], color[ACOMP], xmesa->pixelformat); - for (i=0;i<n;i++) { - if (mask[i]) { - XMesaPutPixel( img, x[i], YFLIP(xrb, y[i]), pixel ); - } - } -} - - -/* - * Write an array of identical TRUEDITHER pixels to an XImage. - */ -static void put_mono_values_TRUEDITHER_ximage( PUT_MONO_VALUES_ARGS ) -{ - const GLubyte *color = (const GLubyte *) value; - const XMesaContext xmesa = XMESA_CONTEXT(ctx); - GET_XRB(xrb); - XMesaImage *img = xrb->ximage; - register GLuint i; - const int r = color[RCOMP], g = color[GCOMP], b = color[BCOMP]; - for (i=0;i<n;i++) { - if (mask[i]) { - unsigned long p; - PACK_TRUEDITHER(p, x[i], YFLIP(xrb, y[i]), r, g, b); - XMesaPutPixel( img, x[i], YFLIP(xrb, y[i]), p ); - } - } -} - - - -/* - * Write an array of identical 8A8B8G8R pixels to an XImage - */ -static void put_mono_values_8A8B8G8R_ximage( PUT_MONO_VALUES_ARGS ) -{ - const GLubyte *color = (const GLubyte *) value; - GET_XRB(xrb); - const GLuint p = PACK_8A8B8G8R(color[RCOMP], color[GCOMP], - color[BCOMP], color[ACOMP]); - register GLuint i; - for (i=0;i<n;i++) { - if (mask[i]) { - GLuint *ptr = PIXEL_ADDR4(xrb, x[i], y[i] ); - *ptr = p; - } - } -} - -/* - * Write an array of identical 8A8R8G8B pixels to an XImage - */ -static void put_mono_values_8A8R8G8B_ximage( PUT_MONO_VALUES_ARGS ) -{ - const GLubyte *color = (const GLubyte *) value; - GET_XRB(xrb); - const GLuint p = PACK_8A8R8G8B(color[RCOMP], color[GCOMP], - color[BCOMP], color[ACOMP]); - register GLuint i; - for (i=0;i<n;i++) { - if (mask[i]) { - GLuint *ptr = PIXEL_ADDR4(xrb, x[i], y[i] ); - *ptr = p; - } - } -} - -/* - * Write an array of identical 8R8G8B pixels to an XImage. - */ -static void put_mono_values_8R8G8B_ximage( PUT_MONO_VALUES_ARGS ) -{ - const GLubyte *color = (const GLubyte *) value; - GET_XRB(xrb); - register GLuint i; - const GLuint p = PACK_8R8G8B(color[RCOMP], color[GCOMP], color[BCOMP]); - for (i=0;i<n;i++) { - if (mask[i]) { - GLuint *ptr = PIXEL_ADDR4(xrb, x[i], y[i] ); - *ptr = p; - } - } -} - - -/* - * Write an array of identical 8R8G8B pixels to an XImage. - */ -static void put_mono_values_8R8G8B24_ximage( PUT_MONO_VALUES_ARGS ) -{ - const GLubyte *color = (const GLubyte *) value; - GET_XRB(xrb); - const GLubyte r = color[RCOMP], g = color[GCOMP], b = color[BCOMP]; - register GLuint i; - for (i=0;i<n;i++) { - if (mask[i]) { - bgr_t *ptr = PIXEL_ADDR3(xrb, x[i], y[i] ); - ptr->r = r; - ptr->g = g; - ptr->b = b; - } - } -} - - -/* - * Write an array of identical PF_DITHER_5R6G5B pixels to an XImage. - */ -static void put_mono_values_DITHER_5R6G5B_ximage( PUT_MONO_VALUES_ARGS ) -{ - const GLubyte *color = (const GLubyte *) value; - GET_XRB(xrb); - const XMesaContext xmesa = XMESA_CONTEXT(ctx); - const int r = color[RCOMP], g = color[GCOMP], b = color[BCOMP]; - register GLuint i; - for (i=0;i<n;i++) { - if (mask[i]) { - GLushort *ptr = PIXEL_ADDR2(xrb, x[i], y[i] ); - PACK_TRUEDITHER(*ptr, x[i], y[i], r, g, b); - } - } -} - - - -/**********************************************************************/ /***** Pixel reading *****/ /**********************************************************************/ @@ -2723,128 +2306,96 @@ xmesa_set_renderbuffer_funcs(struct xmesa_renderbuffer *xrb, if (pixmap) { xrb->Base.PutRow = put_row_TRUECOLOR_pixmap; xrb->Base.PutRowRGB = put_row_rgb_TRUECOLOR_pixmap; - xrb->Base.PutMonoRow = put_mono_row_pixmap; xrb->Base.PutValues = put_values_TRUECOLOR_pixmap; - xrb->Base.PutMonoValues = put_mono_values_pixmap; } else { xrb->Base.PutRow = put_row_TRUECOLOR_ximage; xrb->Base.PutRowRGB = put_row_rgb_TRUECOLOR_ximage; - xrb->Base.PutMonoRow = put_mono_row_ximage; xrb->Base.PutValues = put_values_TRUECOLOR_ximage; - xrb->Base.PutMonoValues = put_mono_values_ximage; } break; case PF_Dither_True: if (pixmap) { xrb->Base.PutRow = put_row_TRUEDITHER_pixmap; xrb->Base.PutRowRGB = put_row_rgb_TRUEDITHER_pixmap; - xrb->Base.PutMonoRow = put_mono_row_TRUEDITHER_pixmap; xrb->Base.PutValues = put_values_TRUEDITHER_pixmap; - xrb->Base.PutMonoValues = put_mono_values_TRUEDITHER_pixmap; } else { xrb->Base.PutRow = put_row_TRUEDITHER_ximage; xrb->Base.PutRowRGB = put_row_rgb_TRUEDITHER_ximage; - xrb->Base.PutMonoRow = put_mono_row_TRUEDITHER_ximage; xrb->Base.PutValues = put_values_TRUEDITHER_ximage; - xrb->Base.PutMonoValues = put_mono_values_TRUEDITHER_ximage; } break; case PF_8A8B8G8R: if (pixmap) { xrb->Base.PutRow = put_row_8A8B8G8R_pixmap; xrb->Base.PutRowRGB = put_row_rgb_8A8B8G8R_pixmap; - xrb->Base.PutMonoRow = put_mono_row_pixmap; xrb->Base.PutValues = put_values_8A8B8G8R_pixmap; - xrb->Base.PutMonoValues = put_mono_values_pixmap; } else { xrb->Base.PutRow = put_row_8A8B8G8R_ximage; xrb->Base.PutRowRGB = put_row_rgb_8A8B8G8R_ximage; - xrb->Base.PutMonoRow = put_mono_row_8A8B8G8R_ximage; xrb->Base.PutValues = put_values_8A8B8G8R_ximage; - xrb->Base.PutMonoValues = put_mono_values_8A8B8G8R_ximage; } break; case PF_8A8R8G8B: if (pixmap) { xrb->Base.PutRow = put_row_8A8R8G8B_pixmap; xrb->Base.PutRowRGB = put_row_rgb_8A8R8G8B_pixmap; - xrb->Base.PutMonoRow = put_mono_row_pixmap; xrb->Base.PutValues = put_values_8A8R8G8B_pixmap; - xrb->Base.PutMonoValues = put_mono_values_pixmap; } else { xrb->Base.PutRow = put_row_8A8R8G8B_ximage; xrb->Base.PutRowRGB = put_row_rgb_8A8R8G8B_ximage; - xrb->Base.PutMonoRow = put_mono_row_8A8R8G8B_ximage; xrb->Base.PutValues = put_values_8A8R8G8B_ximage; - xrb->Base.PutMonoValues = put_mono_values_8A8R8G8B_ximage; } break; case PF_8R8G8B: if (pixmap) { xrb->Base.PutRow = put_row_8R8G8B_pixmap; xrb->Base.PutRowRGB = put_row_rgb_8R8G8B_pixmap; - xrb->Base.PutMonoRow = put_mono_row_pixmap; xrb->Base.PutValues = put_values_8R8G8B_pixmap; - xrb->Base.PutMonoValues = put_mono_values_pixmap; } else { xrb->Base.PutRow = put_row_8R8G8B_ximage; xrb->Base.PutRowRGB = put_row_rgb_8R8G8B_ximage; - xrb->Base.PutMonoRow = put_mono_row_8R8G8B_ximage; xrb->Base.PutValues = put_values_8R8G8B_ximage; - xrb->Base.PutMonoValues = put_mono_values_8R8G8B_ximage; } break; case PF_8R8G8B24: if (pixmap) { xrb->Base.PutRow = put_row_8R8G8B24_pixmap; xrb->Base.PutRowRGB = put_row_rgb_8R8G8B24_pixmap; - xrb->Base.PutMonoRow = put_mono_row_pixmap; xrb->Base.PutValues = put_values_8R8G8B24_pixmap; - xrb->Base.PutMonoValues = put_mono_values_pixmap; } else { xrb->Base.PutRow = put_row_8R8G8B24_ximage; xrb->Base.PutRowRGB = put_row_rgb_8R8G8B24_ximage; - xrb->Base.PutMonoRow = put_mono_row_8R8G8B24_ximage; xrb->Base.PutValues = put_values_8R8G8B24_ximage; - xrb->Base.PutMonoValues = put_mono_values_8R8G8B24_ximage; } break; case PF_5R6G5B: if (pixmap) { xrb->Base.PutRow = put_row_5R6G5B_pixmap; xrb->Base.PutRowRGB = put_row_rgb_5R6G5B_pixmap; - xrb->Base.PutMonoRow = put_mono_row_pixmap; xrb->Base.PutValues = put_values_5R6G5B_pixmap; - xrb->Base.PutMonoValues = put_mono_values_pixmap; } else { xrb->Base.PutRow = put_row_5R6G5B_ximage; xrb->Base.PutRowRGB = put_row_rgb_5R6G5B_ximage; - xrb->Base.PutMonoRow = put_mono_row_ximage; xrb->Base.PutValues = put_values_5R6G5B_ximage; - xrb->Base.PutMonoValues = put_mono_values_ximage; } break; case PF_Dither_5R6G5B: if (pixmap) { xrb->Base.PutRow = put_row_DITHER_5R6G5B_pixmap; xrb->Base.PutRowRGB = put_row_rgb_DITHER_5R6G5B_pixmap; - xrb->Base.PutMonoRow = put_mono_row_TRUEDITHER_pixmap; xrb->Base.PutValues = put_values_DITHER_5R6G5B_pixmap; - xrb->Base.PutMonoValues = put_mono_values_TRUEDITHER_pixmap; } else { xrb->Base.PutRow = put_row_DITHER_5R6G5B_ximage; xrb->Base.PutRowRGB = put_row_rgb_DITHER_5R6G5B_ximage; - xrb->Base.PutMonoRow = put_mono_row_DITHER_5R6G5B_ximage; xrb->Base.PutValues = put_values_DITHER_5R6G5B_ximage; - xrb->Base.PutMonoValues = put_mono_values_DITHER_5R6G5B_ximage; } break; default: |