Remove x/y/width/height parameters from Clear functions.

This commit is contained in:
Brian Paul
2006-11-01 19:35:22 +00:00
parent 533e5a73ee
commit a5676795cf
41 changed files with 156 additions and 207 deletions

View File

@@ -372,10 +372,14 @@ dfbSetViewport( GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h )
} }
static void static void
dfbClear( GLcontext *ctx, GLbitfield mask, GLboolean all, dfbClear( GLcontext *ctx, GLbitfield mask )
GLint x, GLint y, GLint width, GLint height )
{ {
IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx; 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 && if (mask & BUFFER_BIT_FRONT_LEFT &&
ctx->Color.ColorMask[0] && ctx->Color.ColorMask[0] &&
@@ -420,7 +424,7 @@ dfbClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
} }
if (mask) if (mask)
_swrast_Clear( ctx, mask, all, x, y, width, height ); _swrast_Clear( ctx, mask );
} }

View File

@@ -249,8 +249,7 @@ ffb_do_clear(GLcontext *ctx, __DRIdrawablePrivate *dPriv)
} }
} }
void ffbDDClear(GLcontext *ctx, GLbitfield mask, GLboolean allFoo, void ffbDDClear(GLcontext *ctx, GLbitfield mask)
GLint cxFoo, GLint cyFoo, GLint cwidthFoo, GLint cheightFoo)
{ {
ffbContextPtr fmesa = FFB_CONTEXT(ctx); ffbContextPtr fmesa = FFB_CONTEXT(ctx);
__DRIdrawablePrivate *dPriv = fmesa->driDrawable; __DRIdrawablePrivate *dPriv = fmesa->driDrawable;
@@ -334,6 +333,6 @@ void ffbDDClear(GLcontext *ctx, GLbitfield mask, GLboolean allFoo,
} }
if (mask) if (mask)
_swrast_Clear(ctx, mask, 0, 0, 0, 0, 0); _swrast_Clear(ctx, mask);
} }

View File

@@ -1,9 +1,6 @@
/* $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 #ifndef _FFB_CLEAR_H
#define _FFB_CLEAR_H #define _FFB_CLEAR_H
extern void ffbDDClear(GLcontext *ctx, GLbitfield mask, GLboolean all, extern void ffbDDClear(GLcontext *ctx, GLbitfield mask);
GLint cx, GLint cy, GLint cwidth, GLint cheight);
#endif /* !(_FFB_CLEAR_H) */ #endif /* !(_FFB_CLEAR_H) */

View File

@@ -568,8 +568,7 @@ ffbMakeCurrent(__DRIcontextPrivate *driContextPriv,
*/ */
ffbDDClear(fmesa->glCtx, ffbDDClear(fmesa->glCtx,
(BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT | (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT |
BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL), BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL));
1, 0, 0, 0, 0);
} }
} else { } else {
_mesa_make_current(NULL, NULL, NULL); _mesa_make_current(NULL, NULL, NULL);

View File

@@ -205,8 +205,7 @@ static void gammaDDBlendFuncSeparate( GLcontext *ctx,
* Buffer clear * Buffer clear
*/ */
static void gammaDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all, static void gammaDDClear( GLcontext *ctx, GLbitfield mask )
GLint cx, GLint cy, GLint cw, GLint ch )
{ {
gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
GLINTDRIPtr gDRIPriv = (GLINTDRIPtr)gmesa->driScreen->pDevPriv; GLINTDRIPtr gDRIPriv = (GLINTDRIPtr)gmesa->driScreen->pDevPriv;
@@ -410,7 +409,7 @@ static void gammaDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
#endif #endif
if ( mask ) if ( mask )
_swrast_Clear( ctx, mask, all, cx, cy, cw, ch ); _swrast_Clear( ctx, mask );
} }
/* ============================================================= /* =============================================================

View File

@@ -48,8 +48,7 @@ static drmBufPtr i810_get_buffer_ioctl( i810ContextPtr imesa )
#define DEPTH_SCALE ((1<<16)-1) #define DEPTH_SCALE ((1<<16)-1)
static void i810Clear( GLcontext *ctx, GLbitfield mask, GLboolean allFoo, static void i810Clear( GLcontext *ctx, GLbitfield mask )
GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo )
{ {
i810ContextPtr imesa = I810_CONTEXT( ctx ); i810ContextPtr imesa = I810_CONTEXT( ctx );
__DRIdrawablePrivate *dPriv = imesa->driDrawable; __DRIdrawablePrivate *dPriv = imesa->driDrawable;
@@ -142,7 +141,7 @@ static void i810Clear( GLcontext *ctx, GLbitfield mask, GLboolean allFoo,
} }
if (mask) if (mask)
_swrast_Clear( ctx, mask, 0, 0, 0, 0, 0 ); _swrast_Clear( ctx, mask );
} }

View File

@@ -375,8 +375,7 @@ void intelFinish( GLcontext *ctx )
} }
void intelClear(GLcontext *ctx, GLbitfield mask, GLboolean allFoo, void intelClear(GLcontext *ctx, GLbitfield mask)
GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo)
{ {
intelContextPtr intel = INTEL_CONTEXT( ctx ); intelContextPtr intel = INTEL_CONTEXT( ctx );
const GLuint colorMask = *((GLuint *) &ctx->Color.ColorMask); const GLuint colorMask = *((GLuint *) &ctx->Color.ColorMask);
@@ -435,7 +434,7 @@ void intelClear(GLcontext *ctx, GLbitfield mask, GLboolean allFoo,
intel->vtbl.clear_with_tris( intel, tri_mask, 0, 0, 0, 0, 0); intel->vtbl.clear_with_tris( intel, tri_mask, 0, 0, 0, 0, 0);
if (swrast_mask) if (swrast_mask)
_swrast_Clear( ctx, swrast_mask, 0, 0, 0, 0, 0); _swrast_Clear( ctx, swrast_mask );
} }

View File

@@ -32,8 +32,7 @@
extern void intelWaitAgeLocked( intelContextPtr intel, int age, GLboolean unlock ); extern void intelWaitAgeLocked( intelContextPtr intel, int age, GLboolean unlock );
extern void intelClear(GLcontext *ctx, GLbitfield mask, GLboolean all, extern void intelClear(GLcontext *ctx, GLbitfield mask);
GLint cx, GLint cy, GLint cw, GLint ch);
extern void intelPageFlip( const __DRIdrawablePrivate *dpriv ); extern void intelPageFlip( const __DRIdrawablePrivate *dpriv );

View File

@@ -376,8 +376,7 @@ intelEmitCopyBlit(struct intel_context *intel,
* \param mask bitmask of BUFFER_BIT_* values indicating buffers to clear * \param mask bitmask of BUFFER_BIT_* values indicating buffers to clear
*/ */
void void
intelClearWithBlit(GLcontext * ctx, GLbitfield mask, GLboolean allFoo, intelClearWithBlit(GLcontext * ctx, GLbitfield mask)
GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo)
{ {
struct intel_context *intel = intel_context(ctx); struct intel_context *intel = intel_context(ctx);
GLuint clear_depth; GLuint clear_depth;

View File

@@ -35,9 +35,7 @@
extern void intelCopyBuffer(const __DRIdrawablePrivate * dpriv, extern void intelCopyBuffer(const __DRIdrawablePrivate * dpriv,
const drm_clip_rect_t * rect); const drm_clip_rect_t * rect);
extern void intelClearWithBlit(GLcontext * ctx, GLbitfield mask, extern void intelClearWithBlit(GLcontext * ctx, GLbitfield mask);
GLboolean all, GLint cx1, GLint cy1, GLint cw,
GLint ch);
extern void intelEmitCopyBlit(struct intel_context *intel, extern void intelEmitCopyBlit(struct intel_context *intel,
GLuint cpp, GLuint cpp,

View File

@@ -279,9 +279,7 @@ intelWindowMoved(struct intel_context *intel)
* machine independent. Maybe we'll get there one day. * machine independent. Maybe we'll get there one day.
*/ */
static void static void
intelClearWithTris(struct intel_context *intel, intelClearWithTris(struct intel_context *intel, GLbitfield mask)
GLbitfield mask,
GLboolean allFoo, GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo)
{ {
GLcontext *ctx = &intel->ctx; GLcontext *ctx = &intel->ctx;
drm_clip_rect_t clear; drm_clip_rect_t clear;
@@ -534,9 +532,7 @@ intelRotateWindow(struct intel_context *intel,
* Called by ctx->Driver.Clear. * Called by ctx->Driver.Clear.
*/ */
static void static void
intelClear(GLcontext * ctx, intelClear(GLcontext *ctx, GLbitfield mask)
GLbitfield mask,
GLboolean allFoo, GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo)
{ {
struct intel_context *intel = intel_context(ctx); struct intel_context *intel = intel_context(ctx);
const GLuint colorMask = *((GLuint *) & ctx->Color.ColorMask); const GLuint colorMask = *((GLuint *) & ctx->Color.ColorMask);
@@ -603,13 +599,13 @@ intelClear(GLcontext * ctx,
intelFlush(ctx); /* XXX intelClearWithBlit also does this */ intelFlush(ctx); /* XXX intelClearWithBlit also does this */
if (blit_mask) if (blit_mask)
intelClearWithBlit(ctx, blit_mask, 0, 0, 0, 0, 0); intelClearWithBlit(ctx, blit_mask);
if (tri_mask) if (tri_mask)
intelClearWithTris(intel, tri_mask, 0, 0, 0, 0, 0); intelClearWithTris(intel, tri_mask);
if (swrast_mask) if (swrast_mask)
_swrast_Clear(ctx, swrast_mask, 0, 0, 0, 0, 0); _swrast_Clear(ctx, swrast_mask);
} }

View File

@@ -322,14 +322,14 @@ void intelEmitCopyBlit( struct intel_context *intel,
void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all, void intelClearWithBlit(GLcontext *ctx, GLbitfield flags)
GLint cx1, GLint cy1, GLint cw, GLint ch)
{ {
struct intel_context *intel = intel_context( ctx ); struct intel_context *intel = intel_context( ctx );
intelScreenPrivate *intelScreen = intel->intelScreen; intelScreenPrivate *intelScreen = intel->intelScreen;
GLuint clear_depth, clear_color; GLuint clear_depth, clear_color;
GLint cx, cy; GLint cx, cy, cw, ch;
GLint cpp = intelScreen->cpp; GLint cpp = intelScreen->cpp;
GLboolean all;
GLint i; GLint i;
struct intel_region *front = intel->front_region; struct intel_region *front = intel->front_region;
struct intel_region *back = intel->back_region; struct intel_region *back = intel->back_region;
@@ -376,21 +376,16 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all,
intelFlush( &intel->ctx ); intelFlush( &intel->ctx );
LOCK_HARDWARE( intel ); LOCK_HARDWARE( intel );
{ {
/* Refresh the cx/y/w/h values as they may have been invalidated /* get clear bounds after locking */
* by a new window position or size picked up when we did cx = ctx->DrawBuffer->_Xmin;
* LOCK_HARDWARE above. The values passed by mesa are not cy = ctx->DrawBuffer->_Ymin;
* reliable. ch = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
*/ cw = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
{ all = (cw == ctx->DrawBuffer->Width && ch == ctx->DrawBuffer->Height);
cx = ctx->DrawBuffer->_Xmin;
cy = ctx->DrawBuffer->_Ymin;
ch = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
cw = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
}
/* flip top to bottom */ /* flip top to bottom */
cy = intel->driDrawable->h-cy1-ch; cy = intel->driDrawable->h - cy - ch;
cx = cx1 + intel->drawX; cx = cx + intel->drawX;
cy += intel->drawY; cy += intel->drawY;
/* adjust for page flipping */ /* adjust for page flipping */

View File

@@ -35,8 +35,7 @@ struct buffer;
extern void intelCopyBuffer( const __DRIdrawablePrivate *dpriv, extern void intelCopyBuffer( const __DRIdrawablePrivate *dpriv,
const drm_clip_rect_t *rect ); const drm_clip_rect_t *rect );
extern void intelClearWithBlit(GLcontext *ctx, GLbitfield mask, GLboolean all, extern void intelClearWithBlit(GLcontext *ctx, GLbitfield mask);
GLint cx1, GLint cy1, GLint cw, GLint ch);
extern void intelEmitCopyBlit( struct intel_context *intel, extern void intelEmitCopyBlit( struct intel_context *intel,
GLuint cpp, GLuint cpp,

View File

@@ -224,12 +224,11 @@ void intelWindowMoved( struct intel_context *intel )
* machine independent. Maybe we'll get there one day. * machine independent. Maybe we'll get there one day.
*/ */
static void intelClearWithTris(struct intel_context *intel, static void intelClearWithTris(struct intel_context *intel,
GLbitfield mask, GLbitfield mask)
GLboolean all,
GLint cx, GLint cy,
GLint cw, GLint ch)
{ {
GLcontext *ctx = &intel->ctx;
drm_clip_rect_t clear; drm_clip_rect_t clear;
GLint cx, cy, cw, ch;
if (INTEL_DEBUG & DEBUG_DRI) if (INTEL_DEBUG & DEBUG_DRI)
_mesa_printf("%s %x\n", __FUNCTION__, mask); _mesa_printf("%s %x\n", __FUNCTION__, mask);
@@ -238,18 +237,11 @@ static void intelClearWithTris(struct intel_context *intel,
intel->vtbl.install_meta_state(intel); intel->vtbl.install_meta_state(intel);
/* Refresh the cx/y/w/h values as they may have been invalidated /* Get clear bounds after locking */
* by a new window position or size picked up when we did cx = ctx->DrawBuffer->_Xmin;
* LOCK_HARDWARE above. The values passed by mesa are not cy = ctx->DrawBuffer->_Ymin;
* reliable. cw = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
*/ ch = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
{
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;
}
clear.x1 = cx; clear.x1 = cx;
clear.y1 = cy; clear.y1 = cy;
@@ -327,11 +319,7 @@ static void intelClearWithTris(struct intel_context *intel,
static void intelClear(GLcontext *ctx, static void intelClear(GLcontext *ctx, GLbitfield mask)
GLbitfield mask,
GLboolean all,
GLint cx, GLint cy,
GLint cw, GLint ch)
{ {
struct intel_context *intel = intel_context( ctx ); struct intel_context *intel = intel_context( ctx );
const GLuint colorMask = *((GLuint *) &ctx->Color.ColorMask); const GLuint colorMask = *((GLuint *) &ctx->Color.ColorMask);
@@ -340,8 +328,7 @@ static void intelClear(GLcontext *ctx,
GLbitfield swrast_mask = 0; GLbitfield swrast_mask = 0;
if (INTEL_DEBUG & DEBUG_DRI) if (INTEL_DEBUG & DEBUG_DRI)
fprintf(stderr, "%s %x all %d dims %d,%d %dx%d\n", __FUNCTION__, fprintf(stderr, "%s %x\n", __FUNCTION__, mask);
mask, all, cx, cy, cw, ch);
if (mask & BUFFER_BIT_FRONT_LEFT) { if (mask & BUFFER_BIT_FRONT_LEFT) {
@@ -392,13 +379,13 @@ static void intelClear(GLcontext *ctx,
intelFlush( ctx ); intelFlush( ctx );
if (blit_mask) if (blit_mask)
intelClearWithBlit( ctx, blit_mask, all, cx, cy, cw, ch ); intelClearWithBlit( ctx, blit_mask );
if (tri_mask) if (tri_mask)
intelClearWithTris( intel, tri_mask, all, cx, cy, cw, ch); intelClearWithTris( intel, tri_mask );
if (swrast_mask) if (swrast_mask)
_swrast_Clear( ctx, swrast_mask, all, cx, cy, cw, ch ); _swrast_Clear( ctx, swrast_mask );
} }

View File

@@ -665,8 +665,7 @@ void mach64PerformanceBoxesLocked( mach64ContextPtr mmesa )
* Buffer clear * Buffer clear
*/ */
static void mach64DDClear( GLcontext *ctx, GLbitfield mask, GLboolean allFoo, static void mach64DDClear( GLcontext *ctx, GLbitfield mask )
GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo )
{ {
mach64ContextPtr mmesa = MACH64_CONTEXT( ctx ); mach64ContextPtr mmesa = MACH64_CONTEXT( ctx );
__DRIdrawablePrivate *dPriv = mmesa->driDrawable; __DRIdrawablePrivate *dPriv = mmesa->driDrawable;
@@ -713,7 +712,7 @@ static void mach64DDClear( GLcontext *ctx, GLbitfield mask, GLboolean allFoo,
} }
if ( mask ) if ( mask )
_swrast_Clear( ctx, mask, 0, 0, 0, 0, 0 ); _swrast_Clear( ctx, mask );
if ( !flags ) if ( !flags )
return; return;

View File

@@ -204,8 +204,7 @@ drmBufPtr mga_get_buffer_ioctl( mgaContextPtr mmesa )
static void static void
mgaClear( GLcontext *ctx, GLbitfield mask, GLboolean allFoo, mgaClear( GLcontext *ctx, GLbitfield mask )
GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo )
{ {
mgaContextPtr mmesa = MGA_CONTEXT(ctx); mgaContextPtr mmesa = MGA_CONTEXT(ctx);
__DRIdrawablePrivate *dPriv = mmesa->driDrawable; __DRIdrawablePrivate *dPriv = mmesa->driDrawable;
@@ -334,7 +333,7 @@ mgaClear( GLcontext *ctx, GLbitfield mask, GLboolean allFoo,
} }
if (mask) if (mask)
_swrast_Clear( ctx, mask, 0, 0, 0, 0, 0 ); _swrast_Clear( ctx, mask );
} }

View File

@@ -399,8 +399,7 @@ void r128PageFlip( const __DRIdrawablePrivate *dPriv )
* Buffer clear * Buffer clear
*/ */
static void r128Clear( GLcontext *ctx, GLbitfield mask, GLboolean allFoo, static void r128Clear( GLcontext *ctx, GLbitfield mask )
GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo )
{ {
r128ContextPtr rmesa = R128_CONTEXT(ctx); r128ContextPtr rmesa = R128_CONTEXT(ctx);
__DRIdrawablePrivate *dPriv = rmesa->driDrawable; __DRIdrawablePrivate *dPriv = rmesa->driDrawable;
@@ -541,7 +540,7 @@ static void r128Clear( GLcontext *ctx, GLbitfield mask, GLboolean allFoo,
} }
if ( mask ) if ( mask )
_swrast_Clear( ctx, mask, 0, 0, 0, 0, 0 ); _swrast_Clear( ctx, mask );
} }

View File

@@ -605,8 +605,7 @@ void r200PageFlip( const __DRIdrawablePrivate *dPriv )
/* ================================================================ /* ================================================================
* Buffer clear * Buffer clear
*/ */
static void r200Clear( GLcontext *ctx, GLbitfield mask, GLboolean allFoo, static void r200Clear( GLcontext *ctx, GLbitfield mask )
GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo )
{ {
r200ContextPtr rmesa = R200_CONTEXT(ctx); r200ContextPtr rmesa = R200_CONTEXT(ctx);
__DRIdrawablePrivate *dPriv = rmesa->dri.drawable; __DRIdrawablePrivate *dPriv = rmesa->dri.drawable;
@@ -653,7 +652,7 @@ static void r200Clear( GLcontext *ctx, GLbitfield mask, GLboolean allFoo,
if ( mask ) { if ( mask ) {
if (R200_DEBUG & DEBUG_FALLBACKS) if (R200_DEBUG & DEBUG_FALLBACKS)
fprintf(stderr, "%s: swrast clear, mask: %x\n", __FUNCTION__, mask); 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 ) if ( !flags )

View File

@@ -477,8 +477,7 @@ static void r300EmitClearState(GLcontext * ctx)
/** /**
* Buffer clear * Buffer clear
*/ */
static void r300Clear(GLcontext * ctx, GLbitfield mask, GLboolean allFoo, static void r300Clear(GLcontext * ctx, GLbitfield mask)
GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo)
{ {
r300ContextPtr r300 = R300_CONTEXT(ctx); r300ContextPtr r300 = R300_CONTEXT(ctx);
__DRIdrawablePrivate *dPriv = r300->radeon.dri.drawable; __DRIdrawablePrivate *dPriv = r300->radeon.dri.drawable;
@@ -520,7 +519,7 @@ static void r300Clear(GLcontext * ctx, GLbitfield mask, GLboolean allFoo,
if (RADEON_DEBUG & DEBUG_FALLBACKS) if (RADEON_DEBUG & DEBUG_FALLBACKS)
fprintf(stderr, "%s: swrast clear, mask: %x\n", fprintf(stderr, "%s: swrast clear, mask: %x\n",
__FUNCTION__, mask); __FUNCTION__, mask);
_swrast_Clear(ctx, mask, 0, 0, 0, 0, 0); _swrast_Clear(ctx, mask);
} }
swapped = r300->radeon.doPageFlip && (r300->radeon.sarea->pfCurrentPage == 1); swapped = r300->radeon.doPageFlip && (r300->radeon.sarea->pfCurrentPage == 1);

View File

@@ -1021,8 +1021,7 @@ void radeonPageFlip( const __DRIdrawablePrivate *dPriv )
*/ */
#define RADEON_MAX_CLEARS 256 #define RADEON_MAX_CLEARS 256
static void radeonClear( GLcontext *ctx, GLbitfield mask, GLboolean allFoo, static void radeonClear( GLcontext *ctx, GLbitfield mask )
GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo )
{ {
radeonContextPtr rmesa = RADEON_CONTEXT(ctx); radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
__DRIdrawablePrivate *dPriv = rmesa->dri.drawable; __DRIdrawablePrivate *dPriv = rmesa->dri.drawable;
@@ -1071,7 +1070,7 @@ static void radeonClear( GLcontext *ctx, GLbitfield mask, GLboolean allFoo,
if ( mask ) { if ( mask ) {
if (RADEON_DEBUG & DEBUG_FALLBACKS) if (RADEON_DEBUG & DEBUG_FALLBACKS)
fprintf(stderr, "%s: swrast clear, mask: %x\n", __FUNCTION__, mask); 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 ) if ( !flags )

View File

@@ -73,8 +73,7 @@ static void s3vDDBlendFunc( GLcontext *ctx, GLenum sfactor, GLenum dfactor )
* Buffer clear * Buffer clear
*/ */
static void s3vDDClear( GLcontext *ctx, GLbitfield mask, GLboolean allFoo, static void s3vDDClear( GLcontext *ctx, GLbitfield mask )
GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo )
{ {
s3vContextPtr vmesa = S3V_CONTEXT(ctx); s3vContextPtr vmesa = S3V_CONTEXT(ctx);
unsigned int _stride; unsigned int _stride;
@@ -163,7 +162,7 @@ static void s3vDDClear( GLcontext *ctx, GLbitfield mask, GLboolean allFoo,
if ( mask ) if ( mask )
DEBUG(("still masked ;3(\n")); */ /* yes */ DEBUG(("still masked ;3(\n")); */ /* yes */
#else #else
_swrast_Clear( ctx, mask, 0, 0, 0, 0, 0 ); _swrast_Clear( ctx, mask );
#endif #endif
} }

View File

@@ -327,8 +327,7 @@ static GLuint savageIntersectClipRects(drm_clip_rect_t *dest,
} }
static void savageDDClear( GLcontext *ctx, GLbitfield mask, GLboolean allFoo, static void savageDDClear( GLcontext *ctx, GLbitfield mask )
GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo )
{ {
savageContextPtr imesa = SAVAGE_CONTEXT( ctx ); savageContextPtr imesa = SAVAGE_CONTEXT( ctx );
GLuint colorMask, depthMask, clearColor, clearDepth, flags; GLuint colorMask, depthMask, clearColor, clearDepth, flags;
@@ -426,7 +425,7 @@ static void savageDDClear( GLcontext *ctx, GLbitfield mask, GLboolean allFoo,
} }
if (mask) if (mask)
_swrast_Clear( ctx, mask, 0, 0, 0, 0, 0 ); _swrast_Clear( ctx, mask );
} }
/* /*

View File

@@ -69,8 +69,7 @@ sis6326UpdateZPattern(sisContextPtr smesa, GLclampd z)
} }
void void
sis6326DDClear(GLcontext *ctx, GLbitfield mask, GLboolean allFoo, sis6326DDClear(GLcontext *ctx, GLbitfield mask)
GLint xFoo, GLint yFoo, GLint widthFoo, GLint heightFoo)
{ {
sisContextPtr smesa = SIS_CONTEXT(ctx); sisContextPtr smesa = SIS_CONTEXT(ctx);
GLint x1, y1, width1, height1; GLint x1, y1, width1, height1;
@@ -110,7 +109,7 @@ sis6326DDClear(GLcontext *ctx, GLbitfield mask, GLboolean allFoo,
UNLOCK_HARDWARE(); UNLOCK_HARDWARE();
if (mask != 0) if (mask != 0)
_swrast_Clear(ctx, mask, 0, 0, 0, 0, 0); _swrast_Clear(ctx, mask);
} }

View File

@@ -95,8 +95,7 @@ sisUpdateZStencilPattern( sisContextPtr smesa, GLclampd z, GLint stencil )
} }
void void
sisDDClear( GLcontext * ctx, GLbitfield mask, GLboolean allFoo, sisDDClear( GLcontext * ctx, GLbitfield mask )
GLint xFoo, GLint yFoo, GLint widthFoo, GLint heightFoo )
{ {
sisContextPtr smesa = SIS_CONTEXT(ctx); sisContextPtr smesa = SIS_CONTEXT(ctx);
@@ -145,7 +144,7 @@ sisDDClear( GLcontext * ctx, GLbitfield mask, GLboolean allFoo,
UNLOCK_HARDWARE(); UNLOCK_HARDWARE();
if (mask != 0) if (mask != 0)
_swrast_Clear( ctx, mask, 0, 0, 0, 0, 0); _swrast_Clear( ctx, mask);
} }
@@ -329,9 +328,7 @@ sis_clear_color_buffer( GLcontext *ctx, GLenum mask, GLint x, GLint y,
GLint width, GLint height ) GLint width, GLint height )
{ {
sisContextPtr smesa = SIS_CONTEXT(ctx); sisContextPtr smesa = SIS_CONTEXT(ctx);
int count; int count;
GLuint depth = smesa->bytesPerPixel;
drm_clip_rect_t *pExtents = NULL; drm_clip_rect_t *pExtents = NULL;
GLint xx, yy; GLint xx, yy;
GLint x0, y0, width0, height0; GLint x0, y0, width0, height0;
@@ -379,8 +376,6 @@ sis_clear_color_buffer( GLcontext *ctx, GLenum mask, GLint x, GLint y,
if (width <= 0 || height <= 0) if (width <= 0 || height <= 0)
continue; continue;
int cmd;
mWait3DCmdQueue (8); mWait3DCmdQueue (8);
MMIO(REG_SRC_PITCH, (smesa->bytesPerPixel == 4) ? MMIO(REG_SRC_PITCH, (smesa->bytesPerPixel == 4) ?
BLIT_DEPTH_32 : BLIT_DEPTH_16); BLIT_DEPTH_32 : BLIT_DEPTH_16);

View File

@@ -35,15 +35,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "sis_context.h" #include "sis_context.h"
/* sis6326_clear.c */ /* sis6326_clear.c */
extern void sis6326DDClear( GLcontext *ctx, GLbitfield mask, GLboolean all, extern void sis6326DDClear( GLcontext *ctx, GLbitfield mask );
GLint x, GLint y, GLint width, GLint height );
extern void sis6326DDClearColor( GLcontext * ctx, const GLfloat color[4] ); extern void sis6326DDClearColor( GLcontext * ctx, const GLfloat color[4] );
extern void sis6326DDClearDepth( GLcontext * ctx, GLclampd d ); extern void sis6326DDClearDepth( GLcontext * ctx, GLclampd d );
extern void sis6326UpdateZPattern(sisContextPtr smesa, GLclampd z); extern void sis6326UpdateZPattern(sisContextPtr smesa, GLclampd z);
/* sis_clear.c */ /* sis_clear.c */
extern void sisDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all, extern void sisDDClear( GLcontext *ctx, GLbitfield mask );
GLint x, GLint y, GLint width, GLint height );
extern void sisDDClearColor( GLcontext * ctx, const GLfloat color[4] ); extern void sisDDClearColor( GLcontext * ctx, const GLfloat color[4] );
extern void sisDDClearDepth( GLcontext * ctx, GLclampd d ); extern void sisDDClearDepth( GLcontext * ctx, GLclampd d );
extern void sisDDClearStencil( GLcontext * ctx, GLint s ); extern void sisDDClearStencil( GLcontext * ctx, GLint s );

View File

@@ -46,9 +46,7 @@
/* Clear the color and/or depth buffers. /* Clear the color and/or depth buffers.
*/ */
static void tdfxClear( GLcontext *ctx, static void tdfxClear( GLcontext *ctx, GLbitfield mask )
GLbitfield mask, GLboolean all,
GLint xFoo, GLint yFoo, GLint widthFoo, GLint heightFoo)
{ {
tdfxContextPtr fxMesa = (tdfxContextPtr) ctx->DriverCtx; tdfxContextPtr fxMesa = (tdfxContextPtr) ctx->DriverCtx;
GLbitfield softwareMask = mask & (BUFFER_BIT_ACCUM); GLbitfield softwareMask = mask & (BUFFER_BIT_ACCUM);
@@ -312,7 +310,7 @@ static void tdfxClear( GLcontext *ctx,
} }
if (softwareMask) if (softwareMask)
_swrast_Clear( ctx, softwareMask, 0, 0, 0, 0, 0); _swrast_Clear(ctx, softwareMask);
} }

View File

@@ -150,8 +150,7 @@ void tridentCopyBuffer( const __DRIdrawablePrivate *dPriv )
} }
static void tridentDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all, static void tridentDDClear( GLcontext *ctx, GLbitfield mask )
GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo)
{ {
tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx);
unsigned char *MMIO = tmesa->tridentScreen->mmio.map; unsigned char *MMIO = tmesa->tridentScreen->mmio.map;
@@ -297,7 +296,7 @@ if (flags & DRM_TRIDENT_FRONT) {
UNLOCK_HARDWARE(tmesa); UNLOCK_HARDWARE(tmesa);
if ( mask ) if ( mask )
_swrast_Clear( ctx, mask, 0, 0, 0, 0, 0); _swrast_Clear( ctx, mask );
} }
static void tridentDDShadeModel( GLcontext *ctx, GLenum mode ) static void tridentDDShadeModel( GLcontext *ctx, GLenum mode )

View File

@@ -202,8 +202,7 @@ static void viaFillBuffer(struct via_context *vmesa,
static void viaClear(GLcontext *ctx, GLbitfield mask, GLboolean all, static void viaClear(GLcontext *ctx, GLbitfield mask)
GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo)
{ {
struct via_context *vmesa = VIA_CONTEXT(ctx); struct via_context *vmesa = VIA_CONTEXT(ctx);
__DRIdrawablePrivate *dPriv = vmesa->driDrawable; __DRIdrawablePrivate *dPriv = vmesa->driDrawable;
@@ -262,6 +261,7 @@ static void viaClear(GLcontext *ctx, GLbitfield mask, GLboolean all,
drm_clip_rect_t *boxes, *tmp_boxes = 0; drm_clip_rect_t *boxes, *tmp_boxes = 0;
int nr = 0; int nr = 0;
GLint cx, cy, cw, ch; GLint cx, cy, cw, ch;
GLboolean all;
LOCK_HARDWARE(vmesa); LOCK_HARDWARE(vmesa);
@@ -270,6 +270,7 @@ static void viaClear(GLcontext *ctx, GLbitfield mask, GLboolean all,
cy = ctx->DrawBuffer->_Ymin; cy = ctx->DrawBuffer->_Ymin;
cw = ctx->DrawBuffer->_Xmax - cx; cw = ctx->DrawBuffer->_Xmax - cx;
ch = ctx->DrawBuffer->_Ymax - cy; ch = ctx->DrawBuffer->_Ymax - cy;
all = (cw == ctx->DrawBuffer->Width && ch == ctx->DrawBuffer->Height);
/* flip top to bottom */ /* flip top to bottom */
cy = dPriv->h - cy - ch; cy = dPriv->h - cy - ch;
@@ -335,7 +336,7 @@ static void viaClear(GLcontext *ctx, GLbitfield mask, GLboolean all,
} }
if (mask) if (mask)
_swrast_Clear(ctx, mask, 0, 0, 0, 0, 0); _swrast_Clear(ctx, mask);
} }

View File

@@ -313,10 +313,14 @@ static void gl_ggiSetClearColor(GLcontext *ctx, const GLfloat color[4])
ggi_ctx->clearcolor = col; ggi_ctx->clearcolor = col;
} }
static void gl_ggiClear(GLcontext *ctx, GLbitfield mask, GLboolean all, static void gl_ggiClear(GLcontext *ctx, GLbitfield mask)
GLint x, GLint y, GLint width, GLint height)
{ {
ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; 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"); GGIMESADPRINT_CORE("gl_ggiClear() called\n");
@@ -336,7 +340,7 @@ static void gl_ggiClear(GLcontext *ctx, GLbitfield mask, GLboolean all,
mask &= ~(DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT); mask &= ~(DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT);
} }
_swrast_Clear(ctx, mask, all, x, y, width, height); _swrast_Clear(ctx, mask);
} }

View File

@@ -162,9 +162,7 @@ fxDDClearColor(GLcontext * ctx, const GLfloat color[4])
/* Clear the color and/or depth buffers */ /* Clear the color and/or depth buffers */
static void fxDDClear( GLcontext *ctx, static void fxDDClear( GLcontext *ctx, GLbitfield mask )
GLbitfield mask, GLboolean all,
GLint x, GLint y, GLint width, GLint height )
{ {
fxMesaContext fxMesa = FX_CONTEXT(ctx); fxMesaContext fxMesa = FX_CONTEXT(ctx);
GLbitfield softwareMask = mask & (BUFFER_BIT_ACCUM); GLbitfield softwareMask = mask & (BUFFER_BIT_ACCUM);
@@ -173,8 +171,7 @@ static void fxDDClear( GLcontext *ctx,
const FxU8 clearS = (FxU8) (ctx->Stencil.Clear & 0xff); const FxU8 clearS = (FxU8) (ctx->Stencil.Clear & 0xff);
if ( TDFX_DEBUG & MESA_VERBOSE ) { if ( TDFX_DEBUG & MESA_VERBOSE ) {
fprintf( stderr, "fxDDClear( %d, %d, %d, %d )\n", fprintf( stderr, "fxDDClear\n");
(int) x, (int) y, (int) width, (int) height );
} }
/* we can't clear accum buffers nor stereo */ /* we can't clear accum buffers nor stereo */
@@ -389,7 +386,7 @@ static void fxDDClear( GLcontext *ctx,
grRenderBuffer(fxMesa->currentFB); grRenderBuffer(fxMesa->currentFB);
if (softwareMask) if (softwareMask)
_swrast_Clear( ctx, softwareMask, all, x, y, width, height ); _swrast_Clear( ctx, softwareMask );
} }

View File

@@ -1,4 +1,4 @@
/* $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 * Mesa 3-D graphics library
@@ -66,10 +66,14 @@ void __clear_color15( GLcontext *ctx, const GLfloat color[4] )
/* SVGAMesa->clear_hicolor=(red)<<10 | (green)<<5 | (blue);*/ /* SVGAMesa->clear_hicolor=(red)<<10 | (green)<<5 | (blue);*/
} }
void __clear15( GLcontext *ctx, GLbitfield mask, GLboolean all, void __clear15( GLcontext *ctx, GLbitfield mask )
GLint x, GLint y, GLint width, GLint height )
{ {
int i, j; 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 (mask & DD_FRONT_LEFT_BIT) {
GLshort *shortBuffer=(void *)SVGABuffer.FrontBuffer; GLshort *shortBuffer=(void *)SVGABuffer.FrontBuffer;
@@ -105,7 +109,7 @@ void __clear15( GLcontext *ctx, GLbitfield mask, GLboolean all,
} }
if (mask) 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, void __write_rgba_span15( const GLcontext *ctx, GLuint n, GLint x, GLint y,

View File

@@ -1,4 +1,4 @@
/* $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 * Mesa 3-D graphics library
@@ -69,10 +69,14 @@ void __clear_color16( GLcontext *ctx, const GLfloat color[4] )
/* SVGAMesa->clear_hicolor=(red)<<11 | (green)<<5 | (blue); */ /* SVGAMesa->clear_hicolor=(red)<<11 | (green)<<5 | (blue); */
} }
void __clear16( GLcontext *ctx, GLbitfield mask, GLboolean all, void __clear16( GLcontext *ctx, GLbitfield mask )
GLint x, GLint y, GLint width, GLint height )
{ {
int i,j; 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 (mask & DD_FRONT_LEFT_BIT) {
if (all) { if (all) {
@@ -108,7 +112,7 @@ void __clear16( GLcontext *ctx, GLbitfield mask, GLboolean all,
} }
if (mask) 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, void __write_rgba_span16( const GLcontext *ctx, GLuint n, GLint x, GLint y,

View File

@@ -1,4 +1,4 @@
/* $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 * Mesa 3-D graphics library
@@ -91,10 +91,14 @@ void __clear_color24( GLcontext *ctx, const GLfloat color[4] )
/* SVGAMesa->clear_truecolor = red<<16 | green<<8 | blue; */ /* SVGAMesa->clear_truecolor = red<<16 | green<<8 | blue; */
} }
void __clear24( GLcontext *ctx, GLbitfield mask, GLboolean all, void __clear24( GLcontext *ctx, GLbitfield mask )
GLint x, GLint y, GLint width, GLint height )
{ {
int i,j; 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 (mask & DD_FRONT_LEFT_BIT) {
if (all) { if (all) {
@@ -140,7 +144,7 @@ void __clear24( GLcontext *ctx, GLbitfield mask, GLboolean all,
} }
if (mask) 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, void __write_rgba_span24( const GLcontext *ctx, GLuint n, GLint x, GLint y,

View File

@@ -1,4 +1,4 @@
/* $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 * Mesa 3-D graphics library
@@ -85,10 +85,14 @@ void __clear_color32( GLcontext *ctx, const GLfloat color[4] )
SVGAMesa->clear_truecolor = (col[0] << 16) | (col[1] << 8) | col[2]; SVGAMesa->clear_truecolor = (col[0] << 16) | (col[1] << 8) | col[2];
} }
void __clear32( GLcontext *ctx, GLbitfield mask, GLboolean all, void __clear32( GLcontext *ctx, GLbitfield mask )
GLint x, GLint y, GLint width, GLint height )
{ {
int i,j; 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 (mask & DD_FRONT_LEFT_BIT) {
if (all) { if (all) {
@@ -124,7 +128,7 @@ void __clear32( GLcontext *ctx, GLbitfield mask, GLboolean all,
} }
if (mask) 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, void __write_rgba_span32( const GLcontext *ctx, GLuint n, GLint x, GLint y,

View File

@@ -1,4 +1,4 @@
/* $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 * Mesa 3-D graphics library
@@ -60,10 +60,14 @@ void __clear_index8( GLcontext *ctx, GLuint index )
SVGAMesa->clear_index = index; SVGAMesa->clear_index = index;
} }
void __clear8( GLcontext *ctx, GLbitfield mask, GLboolean all, void __clear8( GLcontext *ctx, GLbitfield mask )
GLint x, GLint y, GLint width, GLint height )
{ {
int i,j; 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 (mask & DD_FRONT_LEFT_BIT) {
if (all) { if (all) {
@@ -95,7 +99,7 @@ void __clear8( GLcontext *ctx, GLbitfield mask, GLboolean all,
} }
if (mask) 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, void __write_ci32_span8( const GLcontext *ctx, struct gl_renderbuffer *rb,

View File

@@ -281,11 +281,7 @@ static void clear_color(GLcontext *ctx, const GLfloat color[4])
* Clearing of the other non-color buffers is left to the swrast. * Clearing of the other non-color buffers is left to the swrast.
*/ */
static void clear(GLcontext *ctx, static void clear(GLcontext *ctx, GLbitfield mask)
GLbitfield mask,
GLboolean all,
GLint xFoo, GLint yFoo,
GLint widthFoo, GLint heightFoo)
{ {
#define FLIP(Y) (ctx->DrawBuffer->Height - (Y) - 1) #define FLIP(Y) (ctx->DrawBuffer->Height - (Y) - 1)
const GLint x = ctx->DrawBuffer->_Xmin; const GLint x = ctx->DrawBuffer->_Xmin;
@@ -303,7 +299,7 @@ static void clear(GLcontext *ctx,
ctx->Color.ColorMask[1] != 0xff || ctx->Color.ColorMask[1] != 0xff ||
ctx->Color.ColorMask[2] != 0xff || ctx->Color.ColorMask[2] != 0xff ||
ctx->Color.ColorMask[3] != 0xff) { ctx->Color.ColorMask[3] != 0xff) {
_swrast_Clear(ctx, mask, all, x, y, width, height); _swrast_Clear(ctx, mask);
return; return;
} }
@@ -322,7 +318,8 @@ static void clear(GLcontext *ctx,
/* Try for a fast clear - clearing entire buffer with a single /* Try for a fast clear - clearing entire buffer with a single
* byte value. */ * byte value. */
if (all) { /* entire buffer */ if (width == ctx->DrawBuffer->Width &&
height == ctx->DrawBuffer->Height) { /* entire buffer */
/* Now check for an easy clear value */ /* Now check for an easy clear value */
switch (bytesPerPixel) { switch (bytesPerPixel) {
case 1: case 1:
@@ -435,7 +432,7 @@ static void clear(GLcontext *ctx,
/* Call swrast if there is anything left to clear (like DEPTH) */ /* Call swrast if there is anything left to clear (like DEPTH) */
if (mask) if (mask)
_swrast_Clear(ctx, mask, all, x, y, width, height); _swrast_Clear(ctx, mask);
#undef FLIP #undef FLIP
} }

View File

@@ -383,9 +383,7 @@ clear_nbit_ximage(GLcontext *ctx, struct xmesa_renderbuffer *xrb,
static void static void
clear_buffers( GLcontext *ctx, GLbitfield mask, clear_buffers(GLcontext *ctx, GLbitfield buffers)
GLboolean all, GLint xFoo, GLint yFoo,
GLint widthFoo, GLint heightFoo )
{ {
if (ctx->DrawBuffer->Name == 0) { if (ctx->DrawBuffer->Name == 0) {
/* this is a window system framebuffer */ /* this is a window system framebuffer */
@@ -398,33 +396,33 @@ clear_buffers( GLcontext *ctx, GLbitfield mask,
/* we can't handle color or index masking */ /* we can't handle color or index masking */
if (*colorMask == 0xffffffff && ctx->Color.IndexMask == 0xffffffff) { if (*colorMask == 0xffffffff && ctx->Color.IndexMask == 0xffffffff) {
if (mask & BUFFER_BIT_FRONT_LEFT) { if (buffers & BUFFER_BIT_FRONT_LEFT) {
/* clear front color buffer */ /* clear front color buffer */
struct gl_renderbuffer *frontRb struct gl_renderbuffer *frontRb
= ctx->DrawBuffer->Attachment[BUFFER_FRONT_LEFT].Renderbuffer; = ctx->DrawBuffer->Attachment[BUFFER_FRONT_LEFT].Renderbuffer;
if (b->frontxrb == xmesa_renderbuffer(frontRb)) { if (b->frontxrb == xmesa_renderbuffer(frontRb)) {
/* renderbuffer is not wrapped - great! */ /* renderbuffer is not wrapped - great! */
b->frontxrb->clearFunc(ctx, b->frontxrb, x, y, width, height); b->frontxrb->clearFunc(ctx, b->frontxrb, x, y, width, height);
mask &= ~BUFFER_BIT_FRONT_LEFT; buffers &= ~BUFFER_BIT_FRONT_LEFT;
} }
else { else {
/* we can't directly clear an alpha-wrapped color buffer */ /* 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 */ /* clear back color buffer */
struct gl_renderbuffer *backRb struct gl_renderbuffer *backRb
= ctx->DrawBuffer->Attachment[BUFFER_BACK_LEFT].Renderbuffer; = ctx->DrawBuffer->Attachment[BUFFER_BACK_LEFT].Renderbuffer;
if (b->backxrb == xmesa_renderbuffer(backRb)) { if (b->backxrb == xmesa_renderbuffer(backRb)) {
/* renderbuffer is not wrapped - great! */ /* renderbuffer is not wrapped - great! */
b->backxrb->clearFunc(ctx, b->backxrb, x, y, width, height); b->backxrb->clearFunc(ctx, b->backxrb, x, y, width, height);
mask &= ~BUFFER_BIT_BACK_LEFT; buffers &= ~BUFFER_BIT_BACK_LEFT;
} }
} }
} }
} }
if (mask) if (buffers)
_swrast_Clear( ctx, mask, 0, 0, 0, 0, 0); _swrast_Clear(ctx, buffers);
} }

View File

@@ -141,10 +141,6 @@ _mesa_Clear( GLbitfield mask )
} }
if (ctx->RenderMode == GL_RENDER) { 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; GLbitfield bufferMask;
/* don't clear depth buffer if depth writing disabled */ /* don't clear depth buffer if depth writing disabled */
@@ -177,8 +173,7 @@ _mesa_Clear( GLbitfield mask )
} }
ASSERT(ctx->Driver.Clear); ASSERT(ctx->Driver.Clear);
ctx->Driver.Clear( ctx, bufferMask, (GLboolean) !ctx->Scissor.Enabled, ctx->Driver.Clear(ctx, bufferMask);
x, y, width, height );
} }
} }

View File

@@ -99,19 +99,10 @@ struct dd_function_table {
/** /**
* Clear the color/depth/stencil/accum buffer(s). * Clear the color/depth/stencil/accum buffer(s).
* * \param mask a bitmask of BUFFER_BIT_* flags indicating which
* \param mask a bitmask of the DD_*_BIT values defined above that indicates * renderbuffers need to be cleared.
* 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.
*/ */
void (*Clear)( GLcontext *ctx, GLbitfield mask, GLboolean all, void (*Clear)( GLcontext *ctx, GLbitfield buffers );
GLint x, GLint y, GLint width, GLint height );
/** /**
* \name For hardware accumulation buffer * \name For hardware accumulation buffer

View File

@@ -293,18 +293,15 @@ clear_color_buffers(GLcontext *ctx)
/** /**
* Called via the device driver's ctx->Driver.Clear() function if the * Called via the device driver's ctx->Driver.Clear() function if the
* device driver can't clear one or more of the buffers itself. * device driver can't clear one or more of the buffers itself.
* \param mask bitfield of BUFER_BIT_* values indicating which renderbuffers * \param buffers bitfield of BUFFER_BIT_* values indicating which
* are to be cleared. * renderbuffers are to be cleared.
* \param all if GL_TRUE, clear whole buffer, else clear specified region. * \param all if GL_TRUE, clear whole buffer, else clear specified region.
*/ */
void void
_swrast_Clear(GLcontext *ctx, GLbitfield mask, _swrast_Clear(GLcontext *ctx, GLbitfield buffers)
GLboolean all, GLint x, GLint y, GLint width, GLint height)
{ {
SWcontext *swrast = SWRAST_CONTEXT(ctx); SWcontext *swrast = SWRAST_CONTEXT(ctx);
(void) all; (void) x; (void) y; (void) width; (void) height;
#ifdef DEBUG_FOO #ifdef DEBUG_FOO
{ {
const GLbitfield legalBits = const GLbitfield legalBits =
@@ -319,25 +316,25 @@ _swrast_Clear(GLcontext *ctx, GLbitfield mask,
BUFFER_BIT_AUX1 | BUFFER_BIT_AUX1 |
BUFFER_BIT_AUX2 | BUFFER_BIT_AUX2 |
BUFFER_BIT_AUX3; BUFFER_BIT_AUX3;
assert((mask & (~legalBits)) == 0); assert((buffers & (~legalBits)) == 0);
} }
#endif #endif
RENDER_START(swrast,ctx); RENDER_START(swrast,ctx);
/* do software clearing here */ /* do software clearing here */
if (mask) { if (buffers) {
if (mask & ctx->DrawBuffer->_ColorDrawBufferMask[0]) { if (buffers & ctx->DrawBuffer->_ColorDrawBufferMask[0]) {
clear_color_buffers(ctx); clear_color_buffers(ctx);
} }
if (mask & BUFFER_BIT_DEPTH) { if (buffers & BUFFER_BIT_DEPTH) {
_swrast_clear_depth_buffer(ctx, ctx->DrawBuffer->_DepthBuffer); _swrast_clear_depth_buffer(ctx, ctx->DrawBuffer->_DepthBuffer);
} }
if (mask & BUFFER_BIT_ACCUM) { if (buffers & BUFFER_BIT_ACCUM) {
_swrast_clear_accum_buffer(ctx, _swrast_clear_accum_buffer(ctx,
ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer); ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer);
} }
if (mask & BUFFER_BIT_STENCIL) { if (buffers & BUFFER_BIT_STENCIL) {
_swrast_clear_stencil_buffer(ctx, ctx->DrawBuffer->_StencilBuffer); _swrast_clear_stencil_buffer(ctx, ctx->DrawBuffer->_StencilBuffer);
} }
} }

View File

@@ -130,8 +130,7 @@ _swrast_BlitFramebuffer(GLcontext *ctx,
GLbitfield mask, GLenum filter); GLbitfield mask, GLenum filter);
extern void extern void
_swrast_Clear( GLcontext *ctx, GLbitfield mask, GLboolean all, _swrast_Clear(GLcontext *ctx, GLbitfield buffers);
GLint x, GLint y, GLint width, GLint height );
extern void extern void
_swrast_Accum(GLcontext *ctx, GLenum op, GLfloat value); _swrast_Accum(GLcontext *ctx, GLenum op, GLfloat value);