aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2006-06-06 11:35:17 +0000
committerKeith Whitwell <[email protected]>2006-06-06 11:35:17 +0000
commitbcc480441060b067a5fc4d46f3339a7e778dd091 (patch)
tree818e92ed90c35c8d905f29e54cf510c03e24b769
parenta03b23904119ae6436410b4cbd27fe99a4d2dad6 (diff)
When clearing, refresh the cx/y/w/h values as they may have beentexman_0_1_20060621
invalidated by a new window position or size picked up when we did LOCK_HARDWARE above. The values passed by mesa are not reliable.
-rw-r--r--src/mesa/drivers/dri/i915/intel_blit.c12
-rw-r--r--src/mesa/drivers/dri/i915/intel_buffers.c15
2 files changed, 26 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i915/intel_blit.c b/src/mesa/drivers/dri/i915/intel_blit.c
index 6c0c666f559..aa7a095c84f 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 85ac4180790..d0347a543e6 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;