summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i915tex
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2006-11-01 18:51:43 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2006-11-01 18:51:43 +0000
commit9669804fe476f3497ac7e76e1e7b3e62d547fb6e (patch)
tree638d095038ec9b51891dd756b694a2456f2d1d8d /src/mesa/drivers/dri/i915tex
parent26b5904d7080618718f9ac112bf3d9135366c4e5 (diff)
Don't use the x/y/width/height params passed to Clear(). Get them
after locking. Next: remove the params altogether.
Diffstat (limited to 'src/mesa/drivers/dri/i915tex')
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_blit.c25
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_buffers.c28
2 files changed, 22 insertions, 31 deletions
diff --git a/src/mesa/drivers/dri/i915tex/intel_blit.c b/src/mesa/drivers/dri/i915tex/intel_blit.c
index cbf993fc0e..1781fef569 100644
--- a/src/mesa/drivers/dri/i915tex/intel_blit.c
+++ b/src/mesa/drivers/dri/i915tex/intel_blit.c
@@ -376,8 +376,8 @@ intelEmitCopyBlit(struct intel_context *intel,
* \param mask bitmask of BUFFER_BIT_* values indicating buffers to clear
*/
void
-intelClearWithBlit(GLcontext * ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch)
+intelClearWithBlit(GLcontext * ctx, GLbitfield mask, GLboolean allFoo,
+ GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo)
{
struct intel_context *intel = intel_context(ctx);
GLuint clear_depth;
@@ -409,20 +409,15 @@ intelClearWithBlit(GLcontext * ctx, GLbitfield mask, GLboolean all,
LOCK_HARDWARE(intel);
if (intel->numClipRects) {
+ GLint cx, cy, cw, ch;
drm_clip_rect_t clear;
int i;
- /* 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;
+ cw = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
+ ch = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
if (intel->ctx.DrawBuffer->Name == 0) {
/* clearing a window */
@@ -458,7 +453,9 @@ intelClearWithBlit(GLcontext * ctx, GLbitfield mask, GLboolean all,
const drm_clip_rect_t *box = &intel->pClipRects[i];
drm_clip_rect_t b;
GLuint buf;
- GLuint clearMask = mask; /* use copy, since we modify it below */
+ GLuint clearMask = mask; /* use copy, since we modify it below */
+ GLboolean all = (cw == ctx->DrawBuffer->Width &&
+ ch == ctx->DrawBuffer->Height);
if (!all) {
intel_intersect_cliprects(&b, &clear, box);
diff --git a/src/mesa/drivers/dri/i915tex/intel_buffers.c b/src/mesa/drivers/dri/i915tex/intel_buffers.c
index fe7ef7ec36..3da1420cdd 100644
--- a/src/mesa/drivers/dri/i915tex/intel_buffers.c
+++ b/src/mesa/drivers/dri/i915tex/intel_buffers.c
@@ -281,7 +281,7 @@ intelWindowMoved(struct intel_context *intel)
static void
intelClearWithTris(struct intel_context *intel,
GLbitfield mask,
- GLboolean all, GLint cx, GLint cy, GLint cw, GLint ch)
+ GLboolean allFoo, GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo)
{
GLcontext *ctx = &intel->ctx;
drm_clip_rect_t clear;
@@ -293,22 +293,16 @@ intelClearWithTris(struct intel_context *intel,
/* XXX FBO: was: intel->driDrawable->numClipRects */
if (intel->numClipRects) {
+ GLint cx, cy, cw, ch;
GLuint buf;
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.
- */
- {
- 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;
/* note: regardless of 'all', cx, cy, cw, ch are now correct */
clear.x1 = cx;
@@ -542,7 +536,7 @@ intelRotateWindow(struct intel_context *intel,
static void
intelClear(GLcontext * ctx,
GLbitfield mask,
- GLboolean all, GLint cx, GLint cy, GLint cw, GLint ch)
+ GLboolean allFoo, GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo)
{
struct intel_context *intel = intel_context(ctx);
const GLuint colorMask = *((GLuint *) & ctx->Color.ColorMask);
@@ -609,13 +603,13 @@ intelClear(GLcontext * ctx,
intelFlush(ctx); /* XXX intelClearWithBlit also does this */
if (blit_mask)
- intelClearWithBlit(ctx, blit_mask, all, cx, cy, cw, ch);
+ intelClearWithBlit(ctx, blit_mask, 0, 0, 0, 0, 0);
if (tri_mask)
- intelClearWithTris(intel, tri_mask, all, cx, cy, cw, ch);
+ intelClearWithTris(intel, tri_mask, 0, 0, 0, 0, 0);
if (swrast_mask)
- _swrast_Clear(ctx, swrast_mask, all, cx, cy, cw, ch);
+ _swrast_Clear(ctx, swrast_mask, 0, 0, 0, 0, 0);
}