radeon: Adapt cliprect fixes from r300.
authorAlan Swanson <swanson@ukfsn.org>
Mon, 12 Mar 2007 08:59:28 +0000 (09:59 +0100)
committerMichel Dänzer <michel@tungstengraphics.com>
Mon, 12 Mar 2007 08:59:28 +0000 (09:59 +0100)
src/mesa/drivers/dri/radeon/radeon_context.c
src/mesa/drivers/dri/radeon/radeon_lock.c
src/mesa/drivers/dri/radeon/radeon_state.c

index 6bc2c4aa5c513b1ffb3c5d909ac0c8e56528cc9f..0d25951b64824fac899afc7176bbeeae511806e5 100644 (file)
@@ -594,12 +594,14 @@ radeonMakeCurrent( __DRIcontextPrivate *driContextPriv,
         driDrawableInitVBlank( driDrawPriv, newCtx->vblank_flags,
                                &newCtx->vbl_seq );
       }
-      
-      if ( (newCtx->dri.drawable != driDrawPriv)
-          || (newCtx->dri.readable != driReadPriv) ) {
+
+      newCtx->dri.readable = driReadPriv;
+
+      if ( (newCtx->dri.drawable != driDrawPriv) ||
+           newCtx->lastStamp != driDrawPriv->lastStamp ) {
         newCtx->dri.drawable = driDrawPriv;
-        newCtx->dri.readable = driReadPriv;
 
+        radeonSetCliprects(newCtx);
         radeonUpdateWindow( newCtx->glCtx );
         radeonUpdateViewportOffset( newCtx->glCtx );
       }
index e6ab6af456280e236890416cb82b27f3105f1138..cdf8a19fb13a0be8808d33ca0e0edaf5ba1b97e9 100644 (file)
@@ -96,7 +96,6 @@ void radeonGetLock( radeonContextPtr rmesa, GLuint flags )
       radeonSetCliprects( rmesa );
       radeonUpdateViewportOffset( rmesa->glCtx );
       driUpdateFramebufferSize(rmesa->glCtx, drawable);
-      rmesa->lastStamp = drawable->lastStamp;
    }
 
    RADEON_STATECHANGE( rmesa, ctx );
index e19202fa44324a956c894e6b58d67c32a6397c84..4de05c7697d94a43ec787f5150741dbea3d9968a 100644 (file)
@@ -1675,6 +1675,8 @@ void radeonSetCliprects( radeonContextPtr rmesa )
 
    if (rmesa->state.scissor.enabled)
       radeonRecalcScissorRects( rmesa );
+
+   rmesa->lastStamp = drawable->lastStamp;
 }