-/* $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
#include "extensions.h"
#include "matrix.h"
#include "mtypes.h"
+#include "swrast/swrast.h"
#endif
#include "svgapix.h"
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;
-/* $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
#include "svgapix.h"
#include "svgamesa15.h"
+#include "swrast/swrast.h"
+
static void __svga_drawpixel15(int x, int y, unsigned long c)
{
/* 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;
__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;
__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,
-/* $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
#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] );
-/* $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
#include "svgapix.h"
#include "svgamesa16.h"
+#include "swrast/swrast.h"
static void __svga_drawpixel16(int x, int y, unsigned long c)
/* 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;
__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;
__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,
-/* $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
#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] );
-/* $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
#include "svgapix.h"
#include "svgamesa24.h"
+#include "swrast/swrast.h"
#if 0
/* 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;
SVGAMesa->clear_blue);
SVGABuffer.DrawBuffer = tmp;
}
+ mask &= ~DD_FRONT_LEFT_BIT;
}
if (mask & DD_BACK_LEFT_BIT) {
if (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,
-/* $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
#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] );
-/* $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
#include "svgapix.h"
#include "svgamesa32.h"
+#include "swrast/swrast.h"
+
#if 0
/* this doesn't compile with GCC on RedHat 6.1 */
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;
__svga_drawpixel32(i,j,SVGAMesa->clear_truecolor);
SVGABuffer.DrawBuffer = tmp;
}
+ mask &= ~DD_FRONT_LEFT_BIT;
}
if (mask & DD_BACK_LEFT_BIT) {
if (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,
-/* $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
#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] );
-/* $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
#include "svgapix.h"
#include "svgamesa8.h"
+#include "swrast/swrast.h"
+
static void __svga_drawpixel8(int x, int y, unsigned long c)
{
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;
__svga_drawpixel8(i,j,SVGAMesa->clear_index);
SVGABuffer.DrawBuffer = tmp;
}
+ mask &= ~DD_FRONT_LEFT_BIT;
}
if (mask & DD_BACK_LEFT_BIT) {
if (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,
-/* $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
#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[] );