summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/x11
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2001-01-24 00:04:58 +0000
committerBrian Paul <[email protected]>2001-01-24 00:04:58 +0000
commit74b493a5e61237de081a438e774e5d8139d4c6b7 (patch)
treea8bc94a65bacc67b9b1473f91a2bd84cd2b25937 /src/mesa/drivers/x11
parent125fddc31dc9959901d9f1ece693b09f04426d48 (diff)
Lots of GLchan datatype changes.
Added GLvector4us datatype in math/m_vector.[ch] Added _math_trans_4us() in math/m_translate.[ch] Choose GLvector4ub, GLvector4us, GLvector4f at compile time based on CHAN_BITS. Made Driver.ClearColor() and Driver.ClearIndex() optional driver functions. Changed args to Driver.ClearColor(), updated drivers. Reordered files in Makefile.X11
Diffstat (limited to 'src/mesa/drivers/x11')
-rw-r--r--src/mesa/drivers/x11/xm_dd.c15
-rw-r--r--src/mesa/drivers/x11/xm_span.c33
2 files changed, 22 insertions, 26 deletions
diff --git a/src/mesa/drivers/x11/xm_dd.c b/src/mesa/drivers/x11/xm_dd.c
index 77e4ab58c4c..d6444a51461 100644
--- a/src/mesa/drivers/x11/xm_dd.c
+++ b/src/mesa/drivers/x11/xm_dd.c
@@ -1,4 +1,4 @@
-/* $Id: xm_dd.c,v 1.10 2001/01/16 05:29:43 keithw Exp $ */
+/* $Id: xm_dd.c,v 1.11 2001/01/24 00:04:59 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -229,14 +229,15 @@ clear_index( GLcontext *ctx, GLuint index )
static void
-clear_color( GLcontext *ctx, GLubyte r, GLubyte g, GLubyte b, GLubyte a )
+clear_color( GLcontext *ctx, const GLchan color[4] )
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- xmesa->clearcolor[0] = r;
- xmesa->clearcolor[1] = g;
- xmesa->clearcolor[2] = b;
- xmesa->clearcolor[3] = a;
- xmesa->clearpixel = xmesa_color_to_pixel( xmesa, r, g, b, a,
+ xmesa->clearcolor[0] = color[0];
+ xmesa->clearcolor[1] = color[1];
+ xmesa->clearcolor[2] = color[2];
+ xmesa->clearcolor[3] = color[3];
+ xmesa->clearpixel = xmesa_color_to_pixel( xmesa, color[0], color[1],
+ color[2], color[3],
xmesa->xm_visual->undithered_pf );
_glthread_LOCK_MUTEX(_xmesa_lock);
XMesaSetForeground( xmesa->display, xmesa->xm_buffer->cleargc,
diff --git a/src/mesa/drivers/x11/xm_span.c b/src/mesa/drivers/x11/xm_span.c
index 00c36af44c2..623762f2057 100644
--- a/src/mesa/drivers/x11/xm_span.c
+++ b/src/mesa/drivers/x11/xm_span.c
@@ -1,4 +1,4 @@
-/* $Id: xm_span.c,v 1.5 2001/01/08 04:06:20 keithw Exp $ */
+/* $Id: xm_span.c,v 1.6 2001/01/24 00:04:59 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -4152,17 +4152,14 @@ static void read_color_pixels( const GLcontext *ctx,
static void
-clear_color_HPCR_ximage( GLcontext *ctx,
- GLubyte r, GLubyte g, GLubyte b, GLubyte a )
+clear_color_HPCR_ximage( GLcontext *ctx, const GLchan color[4] )
{
int i;
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- xmesa->clearcolor[0] = r;
- xmesa->clearcolor[1] = g;
- xmesa->clearcolor[2] = b;
- xmesa->clearcolor[3] = a;
- if (r == 0 && g == 0 && b == 0) {
+ COPY_4V(xmesa->clearcolor, color);
+
+ if (color[0] == 0 && color[1] == 0 && color[2] == 0) {
/* black is black */
MEMSET( xmesa->xm_visual->hpcr_clear_ximage_pattern, 0x0 ,
sizeof(xmesa->xm_visual->hpcr_clear_ximage_pattern));
@@ -4171,27 +4168,23 @@ clear_color_HPCR_ximage( GLcontext *ctx,
/* build clear pattern */
for (i=0; i<16; i++) {
xmesa->xm_visual->hpcr_clear_ximage_pattern[0][i] =
- DITHER_HPCR(i, 0, r, g, b);
+ DITHER_HPCR(i, 0, color[0], color[1], color[2]);
xmesa->xm_visual->hpcr_clear_ximage_pattern[1][i] =
- DITHER_HPCR(i, 1, r, g, b);
+ DITHER_HPCR(i, 1, color[0], color[1], color[2]);
}
}
}
static void
-clear_color_HPCR_pixmap( GLcontext *ctx,
- GLubyte r, GLubyte g, GLubyte b, GLubyte a )
+clear_color_HPCR_pixmap( GLcontext *ctx, const GLchan color[4] )
{
int i;
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- xmesa->clearcolor[0] = r;
- xmesa->clearcolor[1] = g;
- xmesa->clearcolor[2] = b;
- xmesa->clearcolor[3] = a;
+ COPY_4V(xmesa->clearcolor, color);
- if (0x0==r && 0x0==g && 0x0==b) {
+ if (color[0] == 0 && color[1] == 0 && color[2] == 0) {
/* black is black */
for (i=0; i<16; i++) {
XMesaPutPixel(xmesa->xm_visual->hpcr_clear_ximage, i, 0, 0);
@@ -4200,8 +4193,10 @@ clear_color_HPCR_pixmap( GLcontext *ctx,
}
else {
for (i=0; i<16; i++) {
- XMesaPutPixel(xmesa->xm_visual->hpcr_clear_ximage, i, 0, DITHER_HPCR(i, 0, r, g, b));
- XMesaPutPixel(xmesa->xm_visual->hpcr_clear_ximage, i, 1, DITHER_HPCR(i, 1, r, g, b));
+ XMesaPutPixel(xmesa->xm_visual->hpcr_clear_ximage, i, 0,
+ DITHER_HPCR(i, 0, color[0], color[1], color[2]));
+ XMesaPutPixel(xmesa->xm_visual->hpcr_clear_ximage, i, 1,
+ DITHER_HPCR(i, 1, color[0], color[1], color[2]));
}
}
/* change tile pixmap content */