| @@ -1,4 +1,4 @@ | |||
| /* $Id: svgamesa.c,v 1.12 2001/01/23 23:39:36 brianp Exp $ */ | |||
| /* $Id: svgamesa.c,v 1.13 2001/02/06 00:03:47 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -46,6 +46,7 @@ | |||
| #include "extensions.h" | |||
| #include "matrix.h" | |||
| #include "mtypes.h" | |||
| #include "swrast/swrast.h" | |||
| #endif | |||
| #include "svgapix.h" | |||
| @@ -285,6 +286,14 @@ static void svgamesa_update_state( GLcontext *ctx, GLuint new_state ) | |||
| ctx->Driver.SetDrawBuffer = set_draw_buffer; | |||
| ctx->Driver.SetReadBuffer = set_read_buffer; | |||
| /* Software rasterizer pixel paths: | |||
| */ | |||
| ctx->Driver.Accum = _swrast_Accum; | |||
| ctx->Driver.Bitmap = _swrast_Bitmap; | |||
| ctx->Driver.CopyPixels = _swrast_CopyPixels; | |||
| ctx->Driver.DrawPixels = _swrast_DrawPixels; | |||
| ctx->Driver.ReadPixels = _swrast_ReadPixels; | |||
| ctx->Driver.PointsFunc = NULL; | |||
| ctx->Driver.LineFunc = NULL; | |||
| ctx->Driver.TriangleFunc = NULL; | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: svgamesa15.c,v 1.8 2001/01/24 00:04:59 brianp Exp $ */ | |||
| /* $Id: svgamesa15.c,v 1.9 2001/02/06 00:03:47 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -35,6 +35,8 @@ | |||
| #include "svgapix.h" | |||
| #include "svgamesa15.h" | |||
| #include "swrast/swrast.h" | |||
| static void __svga_drawpixel15(int x, int y, unsigned long c) | |||
| { | |||
| @@ -60,8 +62,8 @@ void __clear_color15( GLcontext *ctx, const GLchan color[4] ) | |||
| /* SVGAMesa->clear_hicolor=(red)<<10 | (green)<<5 | (blue);*/ | |||
| } | |||
| GLbitfield __clear15( GLcontext *ctx, GLbitfield mask, GLboolean all, | |||
| GLint x, GLint y, GLint width, GLint height ) | |||
| void __clear15( GLcontext *ctx, GLbitfield mask, GLboolean all, | |||
| GLint x, GLint y, GLint width, GLint height ) | |||
| { | |||
| int i, j; | |||
| @@ -79,6 +81,7 @@ GLbitfield __clear15( GLcontext *ctx, GLbitfield mask, GLboolean all, | |||
| __svga_drawpixel15(i,j,SVGAMesa->clear_hicolor); | |||
| SVGABuffer.DrawBuffer = tmp; | |||
| } | |||
| mask &= ~DD_FRONT_LEFT_BIT; | |||
| } | |||
| if (mask & DD_BACK_LEFT_BIT) { | |||
| GLshort *shortBuffer=(void *)SVGABuffer.BackBuffer; | |||
| @@ -94,8 +97,11 @@ GLbitfield __clear15( GLcontext *ctx, GLbitfield mask, GLboolean all, | |||
| __svga_drawpixel15(i,j,SVGAMesa->clear_hicolor); | |||
| SVGABuffer.DrawBuffer = tmp; | |||
| } | |||
| mask &= ~DD_BACK_LEFT_BIT; | |||
| } | |||
| return mask & (~(DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT)); | |||
| if (mask) | |||
| _swrast_Clear( ctx, mask, all, x, y, width, height ); | |||
| } | |||
| void __write_rgba_span15( const GLcontext *ctx, GLuint n, GLint x, GLint y, | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: svgamesa15.h,v 1.5 2001/01/24 00:04:59 brianp Exp $ */ | |||
| /* $Id: svgamesa15.h,v 1.6 2001/02/06 00:03:48 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -32,7 +32,7 @@ | |||
| #define SVGA_MESA_15_H | |||
| extern void __clear_color15( GLcontext *ctx, const GLchan color[4] ); | |||
| extern GLbitfield __clear15( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height ); | |||
| extern void __clear15( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height ); | |||
| extern void __write_rgba_span15( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLubyte rgba[][4], const GLubyte mask[] ); | |||
| extern void __write_mono_rgba_span15( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLchan color[4], const GLubyte mask[]); | |||
| extern void __read_rgba_span15( const GLcontext *ctx, GLuint n, GLint x, GLint y, GLubyte rgba[][4] ); | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: svgamesa16.c,v 1.8 2001/01/24 00:04:59 brianp Exp $ */ | |||
| /* $Id: svgamesa16.c,v 1.9 2001/02/06 00:03:48 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -35,6 +35,7 @@ | |||
| #include "svgapix.h" | |||
| #include "svgamesa16.h" | |||
| #include "swrast/swrast.h" | |||
| static void __svga_drawpixel16(int x, int y, unsigned long c) | |||
| @@ -64,8 +65,8 @@ void __clear_color16( GLcontext *ctx, const GLchan color[4] ) | |||
| /* SVGAMesa->clear_hicolor=(red)<<11 | (green)<<5 | (blue); */ | |||
| } | |||
| GLbitfield __clear16( GLcontext *ctx, GLbitfield mask, GLboolean all, | |||
| GLint x, GLint y, GLint width, GLint height ) | |||
| void __clear16( GLcontext *ctx, GLbitfield mask, GLboolean all, | |||
| GLint x, GLint y, GLint width, GLint height ) | |||
| { | |||
| int i,j; | |||
| @@ -83,7 +84,8 @@ GLbitfield __clear16( GLcontext *ctx, GLbitfield mask, GLboolean all, | |||
| __svga_drawpixel16(i,j,SVGAMesa->clear_hicolor); | |||
| SVGABuffer.DrawBuffer = tmp; | |||
| } | |||
| } | |||
| mask &= ~DD_FRONT_LEFT_BIT; | |||
| } | |||
| if (mask & DD_BACK_LEFT_BIT) { | |||
| if (all) { | |||
| GLshort *shortBuffer=(void *)SVGABuffer.BackBuffer; | |||
| @@ -98,8 +100,11 @@ GLbitfield __clear16( GLcontext *ctx, GLbitfield mask, GLboolean all, | |||
| __svga_drawpixel16(i,j,SVGAMesa->clear_hicolor); | |||
| SVGABuffer.DrawBuffer = tmp; | |||
| } | |||
| } | |||
| return mask & (~(DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT)); | |||
| mask &= ~DD_BACK_LEFT_BIT; | |||
| } | |||
| if (mask) | |||
| _swrast_Clear( ctx, mask, all, x, y, width, height ); | |||
| } | |||
| void __write_rgba_span16( const GLcontext *ctx, GLuint n, GLint x, GLint y, | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: svgamesa16.h,v 1.4 2001/01/24 00:04:59 brianp Exp $ */ | |||
| /* $Id: svgamesa16.h,v 1.5 2001/02/06 00:03:48 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -32,7 +32,7 @@ | |||
| #define SVGA_MESA_16_H | |||
| extern void __clear_color16( GLcontext *ctx, const GLchan color[4] ); | |||
| extern GLbitfield __clear16( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height ); | |||
| extern void __clear16( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height ); | |||
| extern void __write_rgba_span16( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLubyte rgba[][4], const GLubyte mask[] ); | |||
| extern void __write_mono_rgba_span16( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLchan color[4], const GLubyte mask[]); | |||
| extern void __read_rgba_span16( const GLcontext *ctx, GLuint n, GLint x, GLint y, GLubyte rgba[][4] ); | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: svgamesa24.c,v 1.9 2001/01/24 00:04:59 brianp Exp $ */ | |||
| /* $Id: svgamesa24.c,v 1.10 2001/02/06 00:03:48 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -35,6 +35,7 @@ | |||
| #include "svgapix.h" | |||
| #include "svgamesa24.h" | |||
| #include "swrast/swrast.h" | |||
| #if 0 | |||
| @@ -86,8 +87,8 @@ void __clear_color24( GLcontext *ctx, const GLchan color[4] ) | |||
| /* SVGAMesa->clear_truecolor = red<<16 | green<<8 | blue; */ | |||
| } | |||
| GLbitfield __clear24( GLcontext *ctx, GLbitfield mask, GLboolean all, | |||
| GLint x, GLint y, GLint width, GLint height ) | |||
| void __clear24( GLcontext *ctx, GLbitfield mask, GLboolean all, | |||
| GLint x, GLint y, GLint width, GLint height ) | |||
| { | |||
| int i,j; | |||
| @@ -110,6 +111,7 @@ GLbitfield __clear24( GLcontext *ctx, GLbitfield mask, GLboolean all, | |||
| SVGAMesa->clear_blue); | |||
| SVGABuffer.DrawBuffer = tmp; | |||
| } | |||
| mask &= ~DD_FRONT_LEFT_BIT; | |||
| } | |||
| if (mask & DD_BACK_LEFT_BIT) { | |||
| if (all) { | |||
| @@ -130,8 +132,11 @@ GLbitfield __clear24( GLcontext *ctx, GLbitfield mask, GLboolean all, | |||
| SVGAMesa->clear_blue); | |||
| SVGABuffer.DrawBuffer = tmp; | |||
| } | |||
| mask &= ~DD_BACK_LEFT_BIT; | |||
| } | |||
| return mask & (~(DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT)); | |||
| if (mask) | |||
| _swrast_Clear( ctx, mask, all, x, y, width, height ); | |||
| } | |||
| void __write_rgba_span24( const GLcontext *ctx, GLuint n, GLint x, GLint y, | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: svgamesa24.h,v 1.4 2001/01/24 00:04:59 brianp Exp $ */ | |||
| /* $Id: svgamesa24.h,v 1.5 2001/02/06 00:03:48 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -32,7 +32,7 @@ | |||
| #define SVGA_MESA_24_H | |||
| extern void __clear_color24( GLcontext *ctx, const GLchan color[4] ); | |||
| extern GLbitfield __clear24( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height ); | |||
| extern void __clear24( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height ); | |||
| extern void __write_rgba_span24( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLubyte rgba[][4], const GLubyte mask[] ); | |||
| extern void __write_mono_rgba_span24( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLchan color[4], const GLubyte mask[]); | |||
| extern void __read_rgba_span24( const GLcontext *ctx, GLuint n, GLint x, GLint y, GLubyte rgba[][4] ); | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: svgamesa32.c,v 1.9 2001/01/24 00:04:59 brianp Exp $ */ | |||
| /* $Id: svgamesa32.c,v 1.10 2001/02/06 00:03:48 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -35,6 +35,8 @@ | |||
| #include "svgapix.h" | |||
| #include "svgamesa32.h" | |||
| #include "swrast/swrast.h" | |||
| #if 0 | |||
| /* this doesn't compile with GCC on RedHat 6.1 */ | |||
| @@ -79,8 +81,8 @@ void __clear_color32( GLcontext *ctx, const GLchan color[4] ) | |||
| SVGAMesa->clear_truecolor = (color[0] << 16) | (color[1] << 8) | color[2]; | |||
| } | |||
| GLbitfield __clear32( GLcontext *ctx, GLbitfield mask, GLboolean all, | |||
| GLint x, GLint y, GLint width, GLint height ) | |||
| void __clear32( GLcontext *ctx, GLbitfield mask, GLboolean all, | |||
| GLint x, GLint y, GLint width, GLint height ) | |||
| { | |||
| int i,j; | |||
| @@ -98,6 +100,7 @@ GLbitfield __clear32( GLcontext *ctx, GLbitfield mask, GLboolean all, | |||
| __svga_drawpixel32(i,j,SVGAMesa->clear_truecolor); | |||
| SVGABuffer.DrawBuffer = tmp; | |||
| } | |||
| mask &= ~DD_FRONT_LEFT_BIT; | |||
| } | |||
| if (mask & DD_BACK_LEFT_BIT) { | |||
| if (all) { | |||
| @@ -113,8 +116,11 @@ GLbitfield __clear32( GLcontext *ctx, GLbitfield mask, GLboolean all, | |||
| __svga_drawpixel32(i,j,SVGAMesa->clear_truecolor); | |||
| SVGABuffer.DrawBuffer = tmp; | |||
| } | |||
| mask &= ~DD_BACK_LEFT_BIT; | |||
| } | |||
| return mask & (~(DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT)); | |||
| if (mask) | |||
| _swrast_Clear( ctx, mask, all, x, y, width, height ); | |||
| } | |||
| void __write_rgba_span32( const GLcontext *ctx, GLuint n, GLint x, GLint y, | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: svgamesa32.h,v 1.4 2001/01/24 00:04:59 brianp Exp $ */ | |||
| /* $Id: svgamesa32.h,v 1.5 2001/02/06 00:03:48 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -32,7 +32,7 @@ | |||
| #define SVGA_MESA_32_H | |||
| extern void __clear_color32( GLcontext *ctx, const GLchan color[4] ); | |||
| extern GLbitfield __clear32( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height ); | |||
| extern void __clear32( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height ); | |||
| extern void __write_rgba_span32( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLubyte rgba[][4], const GLubyte mask[] ); | |||
| extern void __write_mono_rgba_span32( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLchan color[4], const GLubyte mask[]); | |||
| extern void __read_rgba_span32( const GLcontext *ctx, GLuint n, GLint x, GLint y, GLubyte rgba[][4] ); | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: svgamesa8.c,v 1.7 2000/11/14 17:40:14 brianp Exp $ */ | |||
| /* $Id: svgamesa8.c,v 1.8 2001/02/06 00:03:48 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -36,6 +36,8 @@ | |||
| #include "svgapix.h" | |||
| #include "svgamesa8.h" | |||
| #include "swrast/swrast.h" | |||
| static void __svga_drawpixel8(int x, int y, unsigned long c) | |||
| { | |||
| @@ -58,8 +60,8 @@ void __clear_index8( GLcontext *ctx, GLuint index ) | |||
| SVGAMesa->clear_index = index; | |||
| } | |||
| GLbitfield __clear8( GLcontext *ctx, GLbitfield mask, GLboolean all, | |||
| GLint x, GLint y, GLint width, GLint height ) | |||
| void __clear8( GLcontext *ctx, GLbitfield mask, GLboolean all, | |||
| GLint x, GLint y, GLint width, GLint height ) | |||
| { | |||
| int i,j; | |||
| @@ -75,6 +77,7 @@ GLbitfield __clear8( GLcontext *ctx, GLbitfield mask, GLboolean all, | |||
| __svga_drawpixel8(i,j,SVGAMesa->clear_index); | |||
| SVGABuffer.DrawBuffer = tmp; | |||
| } | |||
| mask &= ~DD_FRONT_LEFT_BIT; | |||
| } | |||
| if (mask & DD_BACK_LEFT_BIT) { | |||
| if (all) { | |||
| @@ -88,8 +91,11 @@ GLbitfield __clear8( GLcontext *ctx, GLbitfield mask, GLboolean all, | |||
| __svga_drawpixel8(i,j,SVGAMesa->clear_index); | |||
| SVGABuffer.DrawBuffer = tmp; | |||
| } | |||
| mask &= ~DD_BACK_LEFT_BIT; | |||
| } | |||
| return mask & (~(DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT)); | |||
| if (mask) | |||
| _swrast_Clear( ctx, mask, all, x, y, width, height ); | |||
| } | |||
| void __write_ci32_span8( const GLcontext *ctx, GLuint n, GLint x, GLint y, | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: svgamesa8.h,v 1.3 2000/11/14 17:40:14 brianp Exp $ */ | |||
| /* $Id: svgamesa8.h,v 1.4 2001/02/06 00:03:48 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -32,7 +32,7 @@ | |||
| #define SVGA_MESA_8_H | |||
| extern void __clear_index8( GLcontext *ctx, GLuint index ); | |||
| extern GLbitfield __clear8( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height ); | |||
| extern void __clear8( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height ); | |||
| extern void __write_ci32_span8( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLuint index[], const GLubyte mask[] ); | |||
| extern void __write_ci8_span8( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLubyte index[], const GLubyte mask[] ); | |||
| extern void __write_mono_ci_span8( const GLcontext *ctx, GLuint n, GLint x, GLint y, GLuint colorIndex, const GLubyte mask[] ); | |||