}
static void
-dfbClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint x, GLint y, GLint width, GLint height )
+dfbClear( GLcontext *ctx, GLbitfield mask )
{
IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx;
+ int x = ctx->DrawBuffer->_Xmin;
+ int y = ctx->DrawBuffer->_Ymin;
+ int width = ctx->DrawBuffer->_Xmax - x;
+ int height = ctx->DrawBuffer->_Ymax - y;
+ GLboolean all = (width == ctx->DrawBuffer->Width && height == ctx->DrawBuffer->height)
if (mask & BUFFER_BIT_FRONT_LEFT &&
ctx->Color.ColorMask[0] &&
}
if (mask)
- _swrast_Clear( ctx, mask, all, x, y, width, height );
+ _swrast_Clear( ctx, mask );
}
}
}
-void ffbDDClear(GLcontext *ctx, GLbitfield mask, GLboolean allFoo,
- GLint cxFoo, GLint cyFoo, GLint cwidthFoo, GLint cheightFoo)
+void ffbDDClear(GLcontext *ctx, GLbitfield mask)
{
ffbContextPtr fmesa = FFB_CONTEXT(ctx);
__DRIdrawablePrivate *dPriv = fmesa->driDrawable;
}
if (mask)
- _swrast_Clear(ctx, mask, 0, 0, 0, 0, 0);
+ _swrast_Clear(ctx, mask);
}
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_clear.h,v 1.2 2002/02/22 21:32:58 dawes Exp $ */
-
#ifndef _FFB_CLEAR_H
#define _FFB_CLEAR_H
-extern void ffbDDClear(GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cwidth, GLint cheight);
+extern void ffbDDClear(GLcontext *ctx, GLbitfield mask);
#endif /* !(_FFB_CLEAR_H) */
*/
ffbDDClear(fmesa->glCtx,
(BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT |
- BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL),
- 1, 0, 0, 0, 0);
+ BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL));
}
} else {
_mesa_make_current(NULL, NULL, NULL);
* Buffer clear
*/
-static void gammaDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch )
+static void gammaDDClear( GLcontext *ctx, GLbitfield mask )
{
gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
GLINTDRIPtr gDRIPriv = (GLINTDRIPtr)gmesa->driScreen->pDevPriv;
#endif
if ( mask )
- _swrast_Clear( ctx, mask, all, cx, cy, cw, ch );
+ _swrast_Clear( ctx, mask );
}
/* =============================================================
#define DEPTH_SCALE ((1<<16)-1)
-static void i810Clear( GLcontext *ctx, GLbitfield mask, GLboolean allFoo,
- GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo )
+static void i810Clear( GLcontext *ctx, GLbitfield mask )
{
i810ContextPtr imesa = I810_CONTEXT( ctx );
__DRIdrawablePrivate *dPriv = imesa->driDrawable;
}
if (mask)
- _swrast_Clear( ctx, mask, 0, 0, 0, 0, 0 );
+ _swrast_Clear( ctx, mask );
}
}
-void intelClear(GLcontext *ctx, GLbitfield mask, GLboolean allFoo,
- GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo)
+void intelClear(GLcontext *ctx, GLbitfield mask)
{
intelContextPtr intel = INTEL_CONTEXT( ctx );
const GLuint colorMask = *((GLuint *) &ctx->Color.ColorMask);
intel->vtbl.clear_with_tris( intel, tri_mask, 0, 0, 0, 0, 0);
if (swrast_mask)
- _swrast_Clear( ctx, swrast_mask, 0, 0, 0, 0, 0);
+ _swrast_Clear( ctx, swrast_mask );
}
extern void intelWaitAgeLocked( intelContextPtr intel, int age, GLboolean unlock );
-extern void intelClear(GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch);
+extern void intelClear(GLcontext *ctx, GLbitfield mask);
extern void intelPageFlip( const __DRIdrawablePrivate *dpriv );
* \param mask bitmask of BUFFER_BIT_* values indicating buffers to clear
*/
void
-intelClearWithBlit(GLcontext * ctx, GLbitfield mask, GLboolean allFoo,
- GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo)
+intelClearWithBlit(GLcontext * ctx, GLbitfield mask)
{
struct intel_context *intel = intel_context(ctx);
GLuint clear_depth;
extern void intelCopyBuffer(const __DRIdrawablePrivate * dpriv,
const drm_clip_rect_t * rect);
-extern void intelClearWithBlit(GLcontext * ctx, GLbitfield mask,
- GLboolean all, GLint cx1, GLint cy1, GLint cw,
- GLint ch);
+extern void intelClearWithBlit(GLcontext * ctx, GLbitfield mask);
extern void intelEmitCopyBlit(struct intel_context *intel,
GLuint cpp,
* machine independent. Maybe we'll get there one day.
*/
static void
-intelClearWithTris(struct intel_context *intel,
- GLbitfield mask,
- GLboolean allFoo, GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo)
+intelClearWithTris(struct intel_context *intel, GLbitfield mask)
{
GLcontext *ctx = &intel->ctx;
drm_clip_rect_t clear;
* Called by ctx->Driver.Clear.
*/
static void
-intelClear(GLcontext * ctx,
- GLbitfield mask,
- GLboolean allFoo, GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo)
+intelClear(GLcontext *ctx, GLbitfield mask)
{
struct intel_context *intel = intel_context(ctx);
const GLuint colorMask = *((GLuint *) & ctx->Color.ColorMask);
intelFlush(ctx); /* XXX intelClearWithBlit also does this */
if (blit_mask)
- intelClearWithBlit(ctx, blit_mask, 0, 0, 0, 0, 0);
+ intelClearWithBlit(ctx, blit_mask);
if (tri_mask)
- intelClearWithTris(intel, tri_mask, 0, 0, 0, 0, 0);
+ intelClearWithTris(intel, tri_mask);
if (swrast_mask)
- _swrast_Clear(ctx, swrast_mask, 0, 0, 0, 0, 0);
+ _swrast_Clear(ctx, swrast_mask);
}
-void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all,
- GLint cx1, GLint cy1, GLint cw, GLint ch)
+void intelClearWithBlit(GLcontext *ctx, GLbitfield flags)
{
struct intel_context *intel = intel_context( ctx );
intelScreenPrivate *intelScreen = intel->intelScreen;
GLuint clear_depth, clear_color;
- GLint cx, cy;
+ GLint cx, cy, cw, ch;
GLint cpp = intelScreen->cpp;
+ GLboolean all;
GLint i;
struct intel_region *front = intel->front_region;
struct intel_region *back = intel->back_region;
intelFlush( &intel->ctx );
LOCK_HARDWARE( intel );
{
- /* Refresh the cx/y/w/h values as they may have been invalidated
- * by a new window position or size picked up when we did
- * LOCK_HARDWARE above. The values passed by mesa are not
- * reliable.
- */
- {
- cx = ctx->DrawBuffer->_Xmin;
- cy = ctx->DrawBuffer->_Ymin;
- ch = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
- cw = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
- }
+ /* get clear bounds after locking */
+ cx = ctx->DrawBuffer->_Xmin;
+ cy = ctx->DrawBuffer->_Ymin;
+ ch = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
+ cw = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
+ all = (cw == ctx->DrawBuffer->Width && ch == ctx->DrawBuffer->Height);
/* flip top to bottom */
- cy = intel->driDrawable->h-cy1-ch;
- cx = cx1 + intel->drawX;
+ cy = intel->driDrawable->h - cy - ch;
+ cx = cx + intel->drawX;
cy += intel->drawY;
/* adjust for page flipping */
extern void intelCopyBuffer( const __DRIdrawablePrivate *dpriv,
const drm_clip_rect_t *rect );
-extern void intelClearWithBlit(GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx1, GLint cy1, GLint cw, GLint ch);
+extern void intelClearWithBlit(GLcontext *ctx, GLbitfield mask);
extern void intelEmitCopyBlit( struct intel_context *intel,
GLuint cpp,
* machine independent. Maybe we'll get there one day.
*/
static void intelClearWithTris(struct intel_context *intel,
- GLbitfield mask,
- GLboolean all,
- GLint cx, GLint cy,
- GLint cw, GLint ch)
+ GLbitfield mask)
{
+ GLcontext *ctx = &intel->ctx;
drm_clip_rect_t clear;
+ GLint cx, cy, cw, ch;
if (INTEL_DEBUG & DEBUG_DRI)
_mesa_printf("%s %x\n", __FUNCTION__, mask);
intel->vtbl.install_meta_state(intel);
- /* Refresh the cx/y/w/h values as they may have been invalidated
- * by a new window position or size picked up when we did
- * LOCK_HARDWARE above. The values passed by mesa are not
- * reliable.
- */
- {
- GLcontext *ctx = &intel->ctx;
- cx = ctx->DrawBuffer->_Xmin;
- cy = ctx->DrawBuffer->_Ymin;
- ch = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
- cw = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
- }
+ /* Get clear bounds after locking */
+ cx = ctx->DrawBuffer->_Xmin;
+ cy = ctx->DrawBuffer->_Ymin;
+ cw = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
+ ch = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
clear.x1 = cx;
clear.y1 = cy;
-static void intelClear(GLcontext *ctx,
- GLbitfield mask,
- GLboolean all,
- GLint cx, GLint cy,
- GLint cw, GLint ch)
+static void intelClear(GLcontext *ctx, GLbitfield mask)
{
struct intel_context *intel = intel_context( ctx );
const GLuint colorMask = *((GLuint *) &ctx->Color.ColorMask);
GLbitfield swrast_mask = 0;
if (INTEL_DEBUG & DEBUG_DRI)
- fprintf(stderr, "%s %x all %d dims %d,%d %dx%d\n", __FUNCTION__,
- mask, all, cx, cy, cw, ch);
+ fprintf(stderr, "%s %x\n", __FUNCTION__, mask);
if (mask & BUFFER_BIT_FRONT_LEFT) {
intelFlush( ctx );
if (blit_mask)
- intelClearWithBlit( ctx, blit_mask, all, cx, cy, cw, ch );
+ intelClearWithBlit( ctx, blit_mask );
if (tri_mask)
- intelClearWithTris( intel, tri_mask, all, cx, cy, cw, ch);
+ intelClearWithTris( intel, tri_mask );
if (swrast_mask)
- _swrast_Clear( ctx, swrast_mask, all, cx, cy, cw, ch );
+ _swrast_Clear( ctx, swrast_mask );
}
* Buffer clear
*/
-static void mach64DDClear( GLcontext *ctx, GLbitfield mask, GLboolean allFoo,
- GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo )
+static void mach64DDClear( GLcontext *ctx, GLbitfield mask )
{
mach64ContextPtr mmesa = MACH64_CONTEXT( ctx );
__DRIdrawablePrivate *dPriv = mmesa->driDrawable;
}
if ( mask )
- _swrast_Clear( ctx, mask, 0, 0, 0, 0, 0 );
+ _swrast_Clear( ctx, mask );
if ( !flags )
return;
static void
-mgaClear( GLcontext *ctx, GLbitfield mask, GLboolean allFoo,
- GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo )
+mgaClear( GLcontext *ctx, GLbitfield mask )
{
mgaContextPtr mmesa = MGA_CONTEXT(ctx);
__DRIdrawablePrivate *dPriv = mmesa->driDrawable;
}
if (mask)
- _swrast_Clear( ctx, mask, 0, 0, 0, 0, 0 );
+ _swrast_Clear( ctx, mask );
}
* Buffer clear
*/
-static void r128Clear( GLcontext *ctx, GLbitfield mask, GLboolean allFoo,
- GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo )
+static void r128Clear( GLcontext *ctx, GLbitfield mask )
{
r128ContextPtr rmesa = R128_CONTEXT(ctx);
__DRIdrawablePrivate *dPriv = rmesa->driDrawable;
}
if ( mask )
- _swrast_Clear( ctx, mask, 0, 0, 0, 0, 0 );
+ _swrast_Clear( ctx, mask );
}
/* ================================================================
* Buffer clear
*/
-static void r200Clear( GLcontext *ctx, GLbitfield mask, GLboolean allFoo,
- GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo )
+static void r200Clear( GLcontext *ctx, GLbitfield mask )
{
r200ContextPtr rmesa = R200_CONTEXT(ctx);
__DRIdrawablePrivate *dPriv = rmesa->dri.drawable;
if ( mask ) {
if (R200_DEBUG & DEBUG_FALLBACKS)
fprintf(stderr, "%s: swrast clear, mask: %x\n", __FUNCTION__, mask);
- _swrast_Clear( ctx, mask, 0, 0, 0, 0, 0 );
+ _swrast_Clear( ctx, mask );
}
if ( !flags )
/**
* Buffer clear
*/
-static void r300Clear(GLcontext * ctx, GLbitfield mask, GLboolean allFoo,
- GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo)
+static void r300Clear(GLcontext * ctx, GLbitfield mask)
{
r300ContextPtr r300 = R300_CONTEXT(ctx);
__DRIdrawablePrivate *dPriv = r300->radeon.dri.drawable;
if (RADEON_DEBUG & DEBUG_FALLBACKS)
fprintf(stderr, "%s: swrast clear, mask: %x\n",
__FUNCTION__, mask);
- _swrast_Clear(ctx, mask, 0, 0, 0, 0, 0);
+ _swrast_Clear(ctx, mask);
}
swapped = r300->radeon.doPageFlip && (r300->radeon.sarea->pfCurrentPage == 1);
*/
#define RADEON_MAX_CLEARS 256
-static void radeonClear( GLcontext *ctx, GLbitfield mask, GLboolean allFoo,
- GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo )
+static void radeonClear( GLcontext *ctx, GLbitfield mask )
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
__DRIdrawablePrivate *dPriv = rmesa->dri.drawable;
if ( mask ) {
if (RADEON_DEBUG & DEBUG_FALLBACKS)
fprintf(stderr, "%s: swrast clear, mask: %x\n", __FUNCTION__, mask);
- _swrast_Clear( ctx, mask, 0, 0, 0, 0, 0 );
+ _swrast_Clear( ctx, mask );
}
if ( !flags )
* Buffer clear
*/
-static void s3vDDClear( GLcontext *ctx, GLbitfield mask, GLboolean allFoo,
- GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo )
+static void s3vDDClear( GLcontext *ctx, GLbitfield mask )
{
s3vContextPtr vmesa = S3V_CONTEXT(ctx);
unsigned int _stride;
if ( mask )
DEBUG(("still masked ;3(\n")); */ /* yes */
#else
- _swrast_Clear( ctx, mask, 0, 0, 0, 0, 0 );
+ _swrast_Clear( ctx, mask );
#endif
}
}
-static void savageDDClear( GLcontext *ctx, GLbitfield mask, GLboolean allFoo,
- GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo )
+static void savageDDClear( GLcontext *ctx, GLbitfield mask )
{
savageContextPtr imesa = SAVAGE_CONTEXT( ctx );
GLuint colorMask, depthMask, clearColor, clearDepth, flags;
}
if (mask)
- _swrast_Clear( ctx, mask, 0, 0, 0, 0, 0 );
+ _swrast_Clear( ctx, mask );
}
/*
}
void
-sis6326DDClear(GLcontext *ctx, GLbitfield mask, GLboolean allFoo,
- GLint xFoo, GLint yFoo, GLint widthFoo, GLint heightFoo)
+sis6326DDClear(GLcontext *ctx, GLbitfield mask)
{
sisContextPtr smesa = SIS_CONTEXT(ctx);
GLint x1, y1, width1, height1;
UNLOCK_HARDWARE();
if (mask != 0)
- _swrast_Clear(ctx, mask, 0, 0, 0, 0, 0);
+ _swrast_Clear(ctx, mask);
}
}
void
-sisDDClear( GLcontext * ctx, GLbitfield mask, GLboolean allFoo,
- GLint xFoo, GLint yFoo, GLint widthFoo, GLint heightFoo )
+sisDDClear( GLcontext * ctx, GLbitfield mask )
{
sisContextPtr smesa = SIS_CONTEXT(ctx);
UNLOCK_HARDWARE();
if (mask != 0)
- _swrast_Clear( ctx, mask, 0, 0, 0, 0, 0);
+ _swrast_Clear( ctx, mask);
}
GLint width, GLint height )
{
sisContextPtr smesa = SIS_CONTEXT(ctx);
-
int count;
- GLuint depth = smesa->bytesPerPixel;
drm_clip_rect_t *pExtents = NULL;
GLint xx, yy;
GLint x0, y0, width0, height0;
if (width <= 0 || height <= 0)
continue;
- int cmd;
-
mWait3DCmdQueue (8);
MMIO(REG_SRC_PITCH, (smesa->bytesPerPixel == 4) ?
BLIT_DEPTH_32 : BLIT_DEPTH_16);
#include "sis_context.h"
/* sis6326_clear.c */
-extern void sis6326DDClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint x, GLint y, GLint width, GLint height );
+extern void sis6326DDClear( GLcontext *ctx, GLbitfield mask );
extern void sis6326DDClearColor( GLcontext * ctx, const GLfloat color[4] );
extern void sis6326DDClearDepth( GLcontext * ctx, GLclampd d );
extern void sis6326UpdateZPattern(sisContextPtr smesa, GLclampd z);
/* sis_clear.c */
-extern void sisDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint x, GLint y, GLint width, GLint height );
+extern void sisDDClear( GLcontext *ctx, GLbitfield mask );
extern void sisDDClearColor( GLcontext * ctx, const GLfloat color[4] );
extern void sisDDClearDepth( GLcontext * ctx, GLclampd d );
extern void sisDDClearStencil( GLcontext * ctx, GLint s );
/* Clear the color and/or depth buffers.
*/
-static void tdfxClear( GLcontext *ctx,
- GLbitfield mask, GLboolean all,
- GLint xFoo, GLint yFoo, GLint widthFoo, GLint heightFoo)
+static void tdfxClear( GLcontext *ctx, GLbitfield mask )
{
tdfxContextPtr fxMesa = (tdfxContextPtr) ctx->DriverCtx;
GLbitfield softwareMask = mask & (BUFFER_BIT_ACCUM);
}
if (softwareMask)
- _swrast_Clear( ctx, softwareMask, 0, 0, 0, 0, 0);
+ _swrast_Clear(ctx, softwareMask);
}
}
-static void tridentDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo)
+static void tridentDDClear( GLcontext *ctx, GLbitfield mask )
{
tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx);
unsigned char *MMIO = tmesa->tridentScreen->mmio.map;
UNLOCK_HARDWARE(tmesa);
if ( mask )
- _swrast_Clear( ctx, mask, 0, 0, 0, 0, 0);
+ _swrast_Clear( ctx, mask );
}
static void tridentDDShadeModel( GLcontext *ctx, GLenum mode )
-static void viaClear(GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo)
+static void viaClear(GLcontext *ctx, GLbitfield mask)
{
struct via_context *vmesa = VIA_CONTEXT(ctx);
__DRIdrawablePrivate *dPriv = vmesa->driDrawable;
drm_clip_rect_t *boxes, *tmp_boxes = 0;
int nr = 0;
GLint cx, cy, cw, ch;
+ GLboolean all;
LOCK_HARDWARE(vmesa);
cy = ctx->DrawBuffer->_Ymin;
cw = ctx->DrawBuffer->_Xmax - cx;
ch = ctx->DrawBuffer->_Ymax - cy;
+ all = (cw == ctx->DrawBuffer->Width && ch == ctx->DrawBuffer->Height);
/* flip top to bottom */
cy = dPriv->h - cy - ch;
}
if (mask)
- _swrast_Clear(ctx, mask, 0, 0, 0, 0, 0);
+ _swrast_Clear(ctx, mask);
}
ggi_ctx->clearcolor = col;
}
-static void gl_ggiClear(GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint x, GLint y, GLint width, GLint height)
+static void gl_ggiClear(GLcontext *ctx, GLbitfield mask)
{
ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx;
+ int x = ctx->DrawBuffer->_Xmin;
+ int y = ctx->DrawBuffer->_Ymin;
+ int w = ctx->DrawBuffer->_Xmax - x;
+ int h = ctx->DrawBuffer->_Ymax - y;
+ GLboolean all = (w == ctx->DrawBuffer->Width && h == ctx->DrawBuffer->height)
GGIMESADPRINT_CORE("gl_ggiClear() called\n");
mask &= ~(DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT);
}
- _swrast_Clear(ctx, mask, all, x, y, width, height);
+ _swrast_Clear(ctx, mask);
}
/* Clear the color and/or depth buffers */
-static void fxDDClear( GLcontext *ctx,
- GLbitfield mask, GLboolean all,
- GLint x, GLint y, GLint width, GLint height )
+static void fxDDClear( GLcontext *ctx, GLbitfield mask )
{
fxMesaContext fxMesa = FX_CONTEXT(ctx);
GLbitfield softwareMask = mask & (BUFFER_BIT_ACCUM);
const FxU8 clearS = (FxU8) (ctx->Stencil.Clear & 0xff);
if ( TDFX_DEBUG & MESA_VERBOSE ) {
- fprintf( stderr, "fxDDClear( %d, %d, %d, %d )\n",
- (int) x, (int) y, (int) width, (int) height );
+ fprintf( stderr, "fxDDClear\n");
}
/* we can't clear accum buffers nor stereo */
grRenderBuffer(fxMesa->currentFB);
if (softwareMask)
- _swrast_Clear( ctx, softwareMask, all, x, y, width, height );
+ _swrast_Clear( ctx, softwareMask );
}
-/* $Id: svgamesa15.c,v 1.11 2002/11/11 18:42:39 brianp Exp $ */
+/* $Id: svgamesa15.c,v 1.12 2006/11/01 19:35:23 brianp Exp $ */
/*
* Mesa 3-D graphics library
/* SVGAMesa->clear_hicolor=(red)<<10 | (green)<<5 | (blue);*/
}
-void __clear15( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint x, GLint y, GLint width, GLint height )
+void __clear15( GLcontext *ctx, GLbitfield mask )
{
int i, j;
+ int x = ctx->DrawBuffer->_Xmin;
+ int y = ctx->DrawBuffer->_Ymin;
+ int width = ctx->DrawBuffer->_Xmax - x;
+ int height = ctx->DrawBuffer->_Ymax - y;
+ GLboolean all = (width == ctx->DrawBuffer->Width && height == ctx->DrawBuffer->height)
if (mask & DD_FRONT_LEFT_BIT) {
GLshort *shortBuffer=(void *)SVGABuffer.FrontBuffer;
}
if (mask)
- _swrast_Clear( ctx, mask, all, x, y, width, height );
+ _swrast_Clear( ctx, mask );
}
void __write_rgba_span15( const GLcontext *ctx, GLuint n, GLint x, GLint y,
-/* $Id: svgamesa16.c,v 1.11 2002/11/11 18:42:40 brianp Exp $ */
+/* $Id: svgamesa16.c,v 1.12 2006/11/01 19:35:23 brianp Exp $ */
/*
* Mesa 3-D graphics library
/* SVGAMesa->clear_hicolor=(red)<<11 | (green)<<5 | (blue); */
}
-void __clear16( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint x, GLint y, GLint width, GLint height )
+void __clear16( GLcontext *ctx, GLbitfield mask )
{
int i,j;
+ int x = ctx->DrawBuffer->_Xmin;
+ int y = ctx->DrawBuffer->_Ymin;
+ int width = ctx->DrawBuffer->_Xmax - x;
+ int height = ctx->DrawBuffer->_Ymax - y;
+ GLboolean all = (width == ctx->DrawBuffer->Width && height == ctx->DrawBuffer->height)
if (mask & DD_FRONT_LEFT_BIT) {
if (all) {
}
if (mask)
- _swrast_Clear( ctx, mask, all, x, y, width, height );
+ _swrast_Clear( ctx, mask );
}
void __write_rgba_span16( const GLcontext *ctx, GLuint n, GLint x, GLint y,
-/* $Id: svgamesa24.c,v 1.12 2002/11/11 18:42:41 brianp Exp $ */
+/* $Id: svgamesa24.c,v 1.13 2006/11/01 19:35:23 brianp Exp $ */
/*
* Mesa 3-D graphics library
/* SVGAMesa->clear_truecolor = red<<16 | green<<8 | blue; */
}
-void __clear24( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint x, GLint y, GLint width, GLint height )
+void __clear24( GLcontext *ctx, GLbitfield mask )
{
int i,j;
+ int x = ctx->DrawBuffer->_Xmin;
+ int y = ctx->DrawBuffer->_Ymin;
+ int width = ctx->DrawBuffer->_Xmax - x;
+ int height = ctx->DrawBuffer->_Ymax - y;
+ GLboolean all = (width == ctx->DrawBuffer->Width && height == ctx->DrawBuffer->height)
if (mask & DD_FRONT_LEFT_BIT) {
if (all) {
}
if (mask)
- _swrast_Clear( ctx, mask, all, x, y, width, height );
+ _swrast_Clear( ctx, mask );
}
void __write_rgba_span24( const GLcontext *ctx, GLuint n, GLint x, GLint y,
-/* $Id: svgamesa32.c,v 1.12 2002/11/11 18:42:42 brianp Exp $ */
+/* $Id: svgamesa32.c,v 1.13 2006/11/01 19:35:23 brianp Exp $ */
/*
* Mesa 3-D graphics library
SVGAMesa->clear_truecolor = (col[0] << 16) | (col[1] << 8) | col[2];
}
-void __clear32( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint x, GLint y, GLint width, GLint height )
+void __clear32( GLcontext *ctx, GLbitfield mask )
{
int i,j;
+ int x = ctx->DrawBuffer->_Xmin;
+ int y = ctx->DrawBuffer->_Ymin;
+ int width = ctx->DrawBuffer->_Xmax - x;
+ int height = ctx->DrawBuffer->_Ymax - y;
+ GLboolean all = (width == ctx->DrawBuffer->Width && height == ctx->DrawBuffer->height)
if (mask & DD_FRONT_LEFT_BIT) {
if (all) {
}
if (mask)
- _swrast_Clear( ctx, mask, all, x, y, width, height );
+ _swrast_Clear( ctx, mask );
}
void __write_rgba_span32( const GLcontext *ctx, GLuint n, GLint x, GLint y,
-/* $Id: svgamesa8.c,v 1.9 2005/05/04 20:11:39 brianp Exp $ */
+/* $Id: svgamesa8.c,v 1.10 2006/11/01 19:35:23 brianp Exp $ */
/*
* Mesa 3-D graphics library
SVGAMesa->clear_index = index;
}
-void __clear8( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint x, GLint y, GLint width, GLint height )
+void __clear8( GLcontext *ctx, GLbitfield mask )
{
int i,j;
+ int x = ctx->DrawBuffer->_Xmin;
+ int y = ctx->DrawBuffer->_Ymin;
+ int width = ctx->DrawBuffer->_Xmax - x;
+ int height = ctx->DrawBuffer->_Ymax - y;
+ GLboolean all = (width == ctx->DrawBuffer->Width && height == ctx->DrawBuffer->height)
if (mask & DD_FRONT_LEFT_BIT) {
if (all) {
}
if (mask)
- _swrast_Clear( ctx, mask, all, x, y, width, height );
+ _swrast_Clear( ctx, mask );
}
void __write_ci32_span8( const GLcontext *ctx, struct gl_renderbuffer *rb,
* Clearing of the other non-color buffers is left to the swrast.
*/
-static void clear(GLcontext *ctx,
- GLbitfield mask,
- GLboolean all,
- GLint xFoo, GLint yFoo,
- GLint widthFoo, GLint heightFoo)
+static void clear(GLcontext *ctx, GLbitfield mask)
{
#define FLIP(Y) (ctx->DrawBuffer->Height - (Y) - 1)
const GLint x = ctx->DrawBuffer->_Xmin;
ctx->Color.ColorMask[1] != 0xff ||
ctx->Color.ColorMask[2] != 0xff ||
ctx->Color.ColorMask[3] != 0xff) {
- _swrast_Clear(ctx, mask, all, x, y, width, height);
+ _swrast_Clear(ctx, mask);
return;
}
/* Try for a fast clear - clearing entire buffer with a single
* byte value. */
- if (all) { /* entire buffer */
+ if (width == ctx->DrawBuffer->Width &&
+ height == ctx->DrawBuffer->Height) { /* entire buffer */
/* Now check for an easy clear value */
switch (bytesPerPixel) {
case 1:
/* Call swrast if there is anything left to clear (like DEPTH) */
if (mask)
- _swrast_Clear(ctx, mask, all, x, y, width, height);
+ _swrast_Clear(ctx, mask);
#undef FLIP
}
static void
-clear_buffers( GLcontext *ctx, GLbitfield mask,
- GLboolean all, GLint xFoo, GLint yFoo,
- GLint widthFoo, GLint heightFoo )
+clear_buffers(GLcontext *ctx, GLbitfield buffers)
{
if (ctx->DrawBuffer->Name == 0) {
/* this is a window system framebuffer */
/* we can't handle color or index masking */
if (*colorMask == 0xffffffff && ctx->Color.IndexMask == 0xffffffff) {
- if (mask & BUFFER_BIT_FRONT_LEFT) {
+ if (buffers & BUFFER_BIT_FRONT_LEFT) {
/* clear front color buffer */
struct gl_renderbuffer *frontRb
= ctx->DrawBuffer->Attachment[BUFFER_FRONT_LEFT].Renderbuffer;
if (b->frontxrb == xmesa_renderbuffer(frontRb)) {
/* renderbuffer is not wrapped - great! */
b->frontxrb->clearFunc(ctx, b->frontxrb, x, y, width, height);
- mask &= ~BUFFER_BIT_FRONT_LEFT;
+ buffers &= ~BUFFER_BIT_FRONT_LEFT;
}
else {
/* we can't directly clear an alpha-wrapped color buffer */
}
}
- if (mask & BUFFER_BIT_BACK_LEFT) {
+ if (buffers & BUFFER_BIT_BACK_LEFT) {
/* clear back color buffer */
struct gl_renderbuffer *backRb
= ctx->DrawBuffer->Attachment[BUFFER_BACK_LEFT].Renderbuffer;
if (b->backxrb == xmesa_renderbuffer(backRb)) {
/* renderbuffer is not wrapped - great! */
b->backxrb->clearFunc(ctx, b->backxrb, x, y, width, height);
- mask &= ~BUFFER_BIT_BACK_LEFT;
+ buffers &= ~BUFFER_BIT_BACK_LEFT;
}
}
}
}
- if (mask)
- _swrast_Clear( ctx, mask, 0, 0, 0, 0, 0);
+ if (buffers)
+ _swrast_Clear(ctx, buffers);
}
}
if (ctx->RenderMode == GL_RENDER) {
- const GLint x = ctx->DrawBuffer->_Xmin;
- const GLint y = ctx->DrawBuffer->_Ymin;
- const GLint height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
- const GLint width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
GLbitfield bufferMask;
/* don't clear depth buffer if depth writing disabled */
}
ASSERT(ctx->Driver.Clear);
- ctx->Driver.Clear( ctx, bufferMask, (GLboolean) !ctx->Scissor.Enabled,
- x, y, width, height );
+ ctx->Driver.Clear(ctx, bufferMask);
}
}
/**
* Clear the color/depth/stencil/accum buffer(s).
- *
- * \param mask a bitmask of the DD_*_BIT values defined above that indicates
- * which buffers need to be cleared.
- * \param all if true then clear the whole buffer, else clear only the
- * region defined by <tt>(x, y, width, height)</tt>.
- *
- * This function must obey the glColorMask(), glIndexMask() and
- * glStencilMask() settings!
- * Software Mesa can do masked clears if the device driver can't.
+ * \param mask a bitmask of BUFFER_BIT_* flags indicating which
+ * renderbuffers need to be cleared.
*/
- void (*Clear)( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint x, GLint y, GLint width, GLint height );
-
+ void (*Clear)( GLcontext *ctx, GLbitfield buffers );
/**
* \name For hardware accumulation buffer
/**
* Called via the device driver's ctx->Driver.Clear() function if the
* device driver can't clear one or more of the buffers itself.
- * \param mask bitfield of BUFER_BIT_* values indicating which renderbuffers
- * are to be cleared.
+ * \param buffers bitfield of BUFFER_BIT_* values indicating which
+ * renderbuffers are to be cleared.
* \param all if GL_TRUE, clear whole buffer, else clear specified region.
*/
void
-_swrast_Clear(GLcontext *ctx, GLbitfield mask,
- GLboolean all, GLint x, GLint y, GLint width, GLint height)
+_swrast_Clear(GLcontext *ctx, GLbitfield buffers)
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
- (void) all; (void) x; (void) y; (void) width; (void) height;
-
#ifdef DEBUG_FOO
{
const GLbitfield legalBits =
BUFFER_BIT_AUX1 |
BUFFER_BIT_AUX2 |
BUFFER_BIT_AUX3;
- assert((mask & (~legalBits)) == 0);
+ assert((buffers & (~legalBits)) == 0);
}
#endif
RENDER_START(swrast,ctx);
/* do software clearing here */
- if (mask) {
- if (mask & ctx->DrawBuffer->_ColorDrawBufferMask[0]) {
+ if (buffers) {
+ if (buffers & ctx->DrawBuffer->_ColorDrawBufferMask[0]) {
clear_color_buffers(ctx);
}
- if (mask & BUFFER_BIT_DEPTH) {
+ if (buffers & BUFFER_BIT_DEPTH) {
_swrast_clear_depth_buffer(ctx, ctx->DrawBuffer->_DepthBuffer);
}
- if (mask & BUFFER_BIT_ACCUM) {
+ if (buffers & BUFFER_BIT_ACCUM) {
_swrast_clear_accum_buffer(ctx,
ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer);
}
- if (mask & BUFFER_BIT_STENCIL) {
+ if (buffers & BUFFER_BIT_STENCIL) {
_swrast_clear_stencil_buffer(ctx, ctx->DrawBuffer->_StencilBuffer);
}
}
GLbitfield mask, GLenum filter);
extern void
-_swrast_Clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint x, GLint y, GLint width, GLint height );
+_swrast_Clear(GLcontext *ctx, GLbitfield buffers);
extern void
_swrast_Accum(GLcontext *ctx, GLenum op, GLfloat value);