summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i915/intel_context.c
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2005-12-30 13:03:08 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2005-12-30 13:03:08 +0000
commitcabecbd3146bf010bb478c9474b34d77afc7431b (patch)
treedc45586aac95eb17f8c4628981e9541154177337 /src/mesa/drivers/dri/i915/intel_context.c
parent1d43e729ec94217f3b742be481c753a8eaa65ea3 (diff)
recalculate state on drawable changes
Diffstat (limited to 'src/mesa/drivers/dri/i915/intel_context.c')
-rw-r--r--src/mesa/drivers/dri/i915/intel_context.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i915/intel_context.c b/src/mesa/drivers/dri/i915/intel_context.c
index d39e45d0b3..170d1df25d 100644
--- a/src/mesa/drivers/dri/i915/intel_context.c
+++ b/src/mesa/drivers/dri/i915/intel_context.c
@@ -140,8 +140,14 @@ static void intelBufferSize(GLframebuffer *buffer,
* to be correct.
*/
LOCK_HARDWARE(intel);
- *width = intel->driDrawable->w;
- *height = intel->driDrawable->h;
+ if (intel->driDrawable) {
+ *width = intel->driDrawable->w;
+ *height = intel->driDrawable->h;
+ }
+ else {
+ *width = 0;
+ *height = 0;
+ }
UNLOCK_HARDWARE(intel);
}
@@ -528,6 +534,19 @@ void intelWindowMoved( intelContextPtr intel )
intelSetFrontClipRects( intel );
}
}
+
+ /* Set state we know depends on drawable parameters:
+ */
+ {
+ GLcontext *ctx = &intel->ctx;
+
+ ctx->Driver.Scissor( ctx, ctx->Scissor.X, ctx->Scissor.Y,
+ ctx->Scissor.Width, ctx->Scissor.Height );
+
+ ctx->Driver.DepthRange( ctx,
+ ctx->Viewport.Near,
+ ctx->Viewport.Far );
+ }
}
GLboolean intelUnbindContext(__DRIcontextPrivate *driContextPriv)