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 6bc2c4a..0d25951 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 e6ab6af..cdf8a19 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 e19202f..4de05c7 100644 (file)
@@ -1675,6 +1675,8 @@ void radeonSetCliprects( radeonContextPtr rmesa )
 
    if (rmesa->state.scissor.enabled)
       radeonRecalcScissorRects( rmesa );
+
+   rmesa->lastStamp = drawable->lastStamp;
 }