From bcc480441060b067a5fc4d46f3339a7e778dd091 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 6 Jun 2006 11:35:17 +0000 Subject: When clearing, 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. --- src/mesa/drivers/dri/i915/intel_blit.c | 12 ++++++++++++ src/mesa/drivers/dri/i915/intel_buffers.c | 15 ++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/i915/intel_blit.c b/src/mesa/drivers/dri/i915/intel_blit.c index 6c0c666f55..aa7a095c84 100644 --- a/src/mesa/drivers/dri/i915/intel_blit.c +++ b/src/mesa/drivers/dri/i915/intel_blit.c @@ -323,6 +323,18 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield mask, GLboolean all, 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; + } + if (intel->ctx.DrawBuffer->Name == 0) { /* clearing a window */ diff --git a/src/mesa/drivers/dri/i915/intel_buffers.c b/src/mesa/drivers/dri/i915/intel_buffers.c index 85ac418079..d0347a543e 100644 --- a/src/mesa/drivers/dri/i915/intel_buffers.c +++ b/src/mesa/drivers/dri/i915/intel_buffers.c @@ -282,7 +282,20 @@ static void intelClearWithTris(struct intel_context *intel, intel->vtbl.install_meta_state(intel); - /* note: regardless of 'all', cx, cy, cw, ch are correct */ + + /* 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; + } + + /* note: regardless of 'all', cx, cy, cw, ch are now correct */ clear.x1 = cx; clear.y1 = cy; clear.x2 = cx + cw; -- cgit v1.2.3