Overlay was not correctly updated when moving the window - it was only updated if

the overlay buffer changed. Found by Marcus.
As a result, the overlay window looks much smoother when moving it around (and it
even starts to move when you don't change the overlay bitmap at all...).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17484 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2006-05-16 19:12:01 +00:00
parent d38c8112a7
commit 8e2f6185f5
3 changed files with 30 additions and 8 deletions

View File

@ -515,6 +515,28 @@ ViewLayer::_UpdateOverlayView() const
}
/*!
This method is called whenever the window is resized or moved - would
be nice to have a better solution for this, though.
*/
void
ViewLayer::UpdateOverlay()
{
if (!IsVisible())
return;
if (_Overlay() != NULL) {
_UpdateOverlayView();
} else {
// recursively ask children of this view
for (ViewLayer* child = FirstChild(); child; child = child->NextSibling()) {
child->UpdateOverlay();
}
}
}
void
ViewLayer::ConvertToParent(BPoint* point) const
{
@ -756,9 +778,6 @@ ViewLayer::MoveBy(int32 x, int32 y, BRegion* dirtyRegion)
// the screen clipping
InvalidateScreenClipping(true);
}
// overlay handling
_UpdateOverlayView();
}
// ResizeBy
@ -822,9 +841,6 @@ ViewLayer::ResizeBy(int32 x, int32 y, BRegion* dirtyRegion)
// TODO: when the implementation of Hide() and Show() is
// complete, see if this should be avoided
RebuildClipping(false);
// overlay handling
_UpdateOverlayView();
}
// ParentResized

View File

@ -183,6 +183,8 @@ class ViewLayer {
// according to the parents visibility
void UpdateVisibleDeep(bool parentVisible);
void UpdateOverlay();
void MarkBackgroundDirty();
bool IsBackgroundDirty() const
{ return fBackgroundDirty; }

View File

@ -316,8 +316,10 @@ WindowLayer::MoveBy(int32 x, int32 y)
if (fDecorator)
fDecorator->MoveBy(x, y);
if (fTopLayer != NULL)
if (fTopLayer != NULL) {
fTopLayer->MoveBy(x, y, NULL);
fTopLayer->UpdateOverlay();
}
// the desktop will take care of dirty regions
@ -373,8 +375,10 @@ WindowLayer::ResizeBy(int32 x, int32 y, BRegion* dirtyRegion)
//}
}
if (fTopLayer != NULL)
if (fTopLayer != NULL) {
fTopLayer->ResizeBy(x, y, dirtyRegion);
fTopLayer->UpdateOverlay();
}
//if (dirtyRegion)
//fDrawingEngine->FillRegion(*dirtyRegion, RGBColor(0, 255, 255, 255));