* Overlay::fVisible was not maintained correctly, but already used in ViewLayer.
* Overlay::SetView() no longer calls HWInterace::UpdateOverlay() if it's currently hidden. * ViewLayer::UpdateVisibleDeep() now calls _UpdateOverlayView() before showing the overlay. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17489 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -522,6 +522,9 @@ ViewLayer::_UpdateOverlayView() const
|
|||||||
void
|
void
|
||||||
ViewLayer::UpdateOverlay()
|
ViewLayer::UpdateOverlay()
|
||||||
{
|
{
|
||||||
|
if (!IsVisible())
|
||||||
|
return;
|
||||||
|
|
||||||
if (_Overlay() != NULL) {
|
if (_Overlay() != NULL) {
|
||||||
_UpdateOverlayView();
|
_UpdateOverlayView();
|
||||||
} else {
|
} else {
|
||||||
@@ -1262,9 +1265,10 @@ ViewLayer::UpdateVisibleDeep(bool parentVisible)
|
|||||||
if (overlay == NULL)
|
if (overlay == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (fVisible && !overlay->IsVisible())
|
if (fVisible && !overlay->IsVisible()) {
|
||||||
|
_UpdateOverlayView();
|
||||||
overlay->Show();
|
overlay->Show();
|
||||||
else if (!fVisible && overlay->IsVisible())
|
} else if (!fVisible && overlay->IsVisible())
|
||||||
overlay->Hide();
|
overlay->Hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,8 @@ Overlay::Overlay(HWInterface& interface)
|
|||||||
fHWInterface(interface),
|
fHWInterface(interface),
|
||||||
fOverlayBuffer(NULL),
|
fOverlayBuffer(NULL),
|
||||||
fClientData(NULL),
|
fClientData(NULL),
|
||||||
fOverlayToken(NULL)
|
fOverlayToken(NULL),
|
||||||
|
fVisible(false)
|
||||||
{
|
{
|
||||||
fSemaphore = create_sem(1, "overlay lock");
|
fSemaphore = create_sem(1, "overlay lock");
|
||||||
fColor.SetColor(21, 16, 21, 16);
|
fColor.SetColor(21, 16, 21, 16);
|
||||||
@@ -118,6 +119,7 @@ Overlay::Show()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fVisible = true;
|
||||||
fHWInterface.ShowOverlay(this);
|
fHWInterface.ShowOverlay(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -128,6 +130,7 @@ Overlay::Hide()
|
|||||||
if (fOverlayToken == NULL)
|
if (fOverlayToken == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
fVisible = false;
|
||||||
fHWInterface.HideOverlay(this);
|
fHWInterface.HideOverlay(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -186,6 +189,7 @@ Overlay::SetView(const BRect& source, const BRect& destination)
|
|||||||
fWindow.width = (uint16)destination.IntegerWidth() + 1;
|
fWindow.width = (uint16)destination.IntegerWidth() + 1;
|
||||||
fWindow.height = (uint16)destination.IntegerHeight() + 1;
|
fWindow.height = (uint16)destination.IntegerHeight() + 1;
|
||||||
|
|
||||||
fHWInterface.UpdateOverlay(this);
|
if (fVisible)
|
||||||
|
fHWInterface.UpdateOverlay(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,8 +47,6 @@ class Overlay {
|
|||||||
const RGBColor& Color() const
|
const RGBColor& Color() const
|
||||||
{ return fColor; }
|
{ return fColor; }
|
||||||
|
|
||||||
void SetVisible(bool visible)
|
|
||||||
{ fVisible = visible; }
|
|
||||||
bool IsVisible() const
|
bool IsVisible() const
|
||||||
{ return fVisible; }
|
{ return fVisible; }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user