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
This commit is contained in:
Stephan Aßmus 2009-01-31 20:11:34 +00:00
parent 10bc1510be
commit 740ea80754
1 changed files with 11 additions and 1 deletions

View File

@ -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