diff options
author | Brian Paul <[email protected]> | 2006-11-01 19:35:22 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2006-11-01 19:35:22 +0000 |
commit | a5676795cfe2e24979b5da65c2f499049ab009d9 (patch) | |
tree | dfd5410b799bceb46a5787f0dbad0a90ac4b8809 /src/mesa/drivers/dri/i965 | |
parent | 533e5a73ee8fbc500b711aff566f00c10812ad4d (diff) |
Remove x/y/width/height parameters from Clear functions.
Diffstat (limited to 'src/mesa/drivers/dri/i965')
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_blit.c | 27 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_blit.h | 3 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_buffers.c | 39 |
3 files changed, 25 insertions, 44 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_blit.c b/src/mesa/drivers/dri/i965/intel_blit.c index e501f5e6609..0974f1f80ad 100644 --- a/src/mesa/drivers/dri/i965/intel_blit.c +++ b/src/mesa/drivers/dri/i965/intel_blit.c @@ -322,14 +322,14 @@ void intelEmitCopyBlit( struct intel_context *intel, -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; @@ -376,21 +376,16 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all, 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 */ diff --git a/src/mesa/drivers/dri/i965/intel_blit.h b/src/mesa/drivers/dri/i965/intel_blit.h index 71ce8307784..b15fb1c2b7f 100644 --- a/src/mesa/drivers/dri/i965/intel_blit.h +++ b/src/mesa/drivers/dri/i965/intel_blit.h @@ -35,8 +35,7 @@ struct buffer; 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, diff --git a/src/mesa/drivers/dri/i965/intel_buffers.c b/src/mesa/drivers/dri/i965/intel_buffers.c index dc5b9c0bc42..d155c039d77 100644 --- a/src/mesa/drivers/dri/i965/intel_buffers.c +++ b/src/mesa/drivers/dri/i965/intel_buffers.c @@ -224,12 +224,11 @@ void intelWindowMoved( struct intel_context *intel ) * 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); @@ -238,18 +237,11 @@ static void intelClearWithTris(struct intel_context *intel, 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; @@ -327,11 +319,7 @@ static void intelClearWithTris(struct intel_context *intel, -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); @@ -340,8 +328,7 @@ static void intelClear(GLcontext *ctx, 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) { @@ -392,13 +379,13 @@ static void intelClear(GLcontext *ctx, 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 ); } |