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:
@@ -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
|
void
|
||||||
ViewLayer::ConvertToParent(BPoint* point) const
|
ViewLayer::ConvertToParent(BPoint* point) const
|
||||||
{
|
{
|
||||||
@@ -756,9 +778,6 @@ ViewLayer::MoveBy(int32 x, int32 y, BRegion* dirtyRegion)
|
|||||||
// the screen clipping
|
// the screen clipping
|
||||||
InvalidateScreenClipping(true);
|
InvalidateScreenClipping(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// overlay handling
|
|
||||||
_UpdateOverlayView();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ResizeBy
|
// ResizeBy
|
||||||
@@ -822,9 +841,6 @@ ViewLayer::ResizeBy(int32 x, int32 y, BRegion* dirtyRegion)
|
|||||||
// TODO: when the implementation of Hide() and Show() is
|
// TODO: when the implementation of Hide() and Show() is
|
||||||
// complete, see if this should be avoided
|
// complete, see if this should be avoided
|
||||||
RebuildClipping(false);
|
RebuildClipping(false);
|
||||||
|
|
||||||
// overlay handling
|
|
||||||
_UpdateOverlayView();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ParentResized
|
// ParentResized
|
||||||
|
|||||||
@@ -183,6 +183,8 @@ class ViewLayer {
|
|||||||
// according to the parents visibility
|
// according to the parents visibility
|
||||||
void UpdateVisibleDeep(bool parentVisible);
|
void UpdateVisibleDeep(bool parentVisible);
|
||||||
|
|
||||||
|
void UpdateOverlay();
|
||||||
|
|
||||||
void MarkBackgroundDirty();
|
void MarkBackgroundDirty();
|
||||||
bool IsBackgroundDirty() const
|
bool IsBackgroundDirty() const
|
||||||
{ return fBackgroundDirty; }
|
{ return fBackgroundDirty; }
|
||||||
|
|||||||
@@ -316,8 +316,10 @@ WindowLayer::MoveBy(int32 x, int32 y)
|
|||||||
if (fDecorator)
|
if (fDecorator)
|
||||||
fDecorator->MoveBy(x, y);
|
fDecorator->MoveBy(x, y);
|
||||||
|
|
||||||
if (fTopLayer != NULL)
|
if (fTopLayer != NULL) {
|
||||||
fTopLayer->MoveBy(x, y, NULL);
|
fTopLayer->MoveBy(x, y, NULL);
|
||||||
|
fTopLayer->UpdateOverlay();
|
||||||
|
}
|
||||||
|
|
||||||
// the desktop will take care of dirty regions
|
// 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->ResizeBy(x, y, dirtyRegion);
|
||||||
|
fTopLayer->UpdateOverlay();
|
||||||
|
}
|
||||||
|
|
||||||
//if (dirtyRegion)
|
//if (dirtyRegion)
|
||||||
//fDrawingEngine->FillRegion(*dirtyRegion, RGBColor(0, 255, 255, 255));
|
//fDrawingEngine->FillRegion(*dirtyRegion, RGBColor(0, 255, 255, 255));
|
||||||
|
|||||||
Reference in New Issue
Block a user