summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2006-10-16 21:39:34 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2006-10-16 21:39:34 +0000
commit16345022de1f443c7746f9f735bb495415e7a5ff (patch)
treea832796f61cdadda5244c2b6ad446f786966ae19
parent7b1ff326071658d5bd6e7feb2ad78d0e0209211d (diff)
Updates to intelWindowMoved():
Only need to call _mesa_resize_framebuffer() when we've detected a window size change. Set the drawFb->Initalized flag to GL_TRUE to avoid obsolete Driver.GetBufferSize/ResizeBuffer calls in the Mesa code.
-rw-r--r--src/mesa/drivers/dri/i915/intel_context.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/i915/intel_context.c b/src/mesa/drivers/dri/i915/intel_context.c
index 2a8ccccaa5..0f89972b70 100644
--- a/src/mesa/drivers/dri/i915/intel_context.c
+++ b/src/mesa/drivers/dri/i915/intel_context.c
@@ -538,14 +538,14 @@ void intelSetBackClipRects( intelContextPtr intel )
void intelWindowMoved( intelContextPtr intel )
{
__DRIdrawablePrivate *dPriv = intel->driDrawable;
+ GLframebuffer *drawFb = (GLframebuffer *) dPriv->driverPrivate;
if (!intel->ctx.DrawBuffer) {
intelSetFrontClipRects( intel );
}
else {
driUpdateFramebufferSize(&intel->ctx, dPriv);
-
- switch (intel->ctx.DrawBuffer->_ColorDrawBufferMask[0]) {
+ switch (drawFb->_ColorDrawBufferMask[0]) {
case BUFFER_BIT_FRONT_LEFT:
intelSetFrontClipRects( intel );
break;
@@ -558,10 +558,12 @@ void intelWindowMoved( intelContextPtr intel )
}
}
- _mesa_resize_framebuffer(&intel->ctx,
- (GLframebuffer*)dPriv->driverPrivate,
- dPriv->w, dPriv->h);
-
+ if (drawFb->Width != dPriv->w || drawFb->Height != dPriv->h) {
+ /* update Mesa's notion of framebuffer/window size */
+ _mesa_resize_framebuffer(&intel->ctx, drawFb, dPriv->w, dPriv->h);
+ drawFb->Initialized = GL_TRUE; /* XXX remove someday */
+ }
+
/* Set state we know depends on drawable parameters:
*/
{