From 740ea80754c88a5026064846bf7df48971e56fac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sat, 31 Jan 2009 20:11:34 +0000 Subject: [PATCH] Exclude any dirty regions from scrolling or copybitting. The previous behavior, which was also the BeOS behavior IIRC, has annoyed me a bit as an application developer. It wasn't possible to avoid display artifacts, if for example scrolling a view which needed to be redrawn at the same time. It sounds strange, but makes perfect sense for the situation I have here. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29101 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/Window.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/servers/app/Window.cpp b/src/servers/app/Window.cpp index 42512a28cf..d964c5121f 100644 --- a/src/servers/app/Window.cpp +++ b/src/servers/app/Window.cpp @@ -439,6 +439,7 @@ Window::CopyContents(BRegion* region, int32 xOffset, int32 yOffset) // is used directly) region->IntersectWith(&VisibleContentRegion()); if (region->CountRects() > 0) { + // Constrain to content region at destination region->OffsetBy(xOffset, yOffset); region->IntersectWith(&fVisibleContentRegion); if (region->CountRects() > 0) { @@ -448,7 +449,16 @@ Window::CopyContents(BRegion* region, int32 xOffset, int32 yOffset) // the part which we can copy is not dirty newDirty->Exclude(region); - fDrawingEngine->CopyRegion(region, xOffset, yOffset); + BRegion* copyRegion = fRegionPool.GetRegion(*region); + if (copyRegion != NULL) { + copyRegion->Exclude(&fPendingUpdateSession->DirtyRegion()); + copyRegion->Exclude(&fCurrentUpdateSession->DirtyRegion()); + copyRegion->Exclude(&fDirtyRegion); + fDrawingEngine->CopyRegion(copyRegion, xOffset, yOffset); + fRegionPool.Recycle(copyRegion); + } else { + fDrawingEngine->CopyRegion(region, xOffset, yOffset); + } // move along the already dirty regions that are common // with the region that we could copy