added marking a ViewLayer dirty (ie if background needs to be cleared yet)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15626 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
a07317fc10
commit
3c0e5f8e8b
@ -44,6 +44,7 @@ ViewLayer::ViewLayer(BRect frame, const char* name,
|
|||||||
// ViewLayers start visible by default
|
// ViewLayers start visible by default
|
||||||
fHidden(false),
|
fHidden(false),
|
||||||
fVisible(true),
|
fVisible(true),
|
||||||
|
fBackgroundDirty(true),
|
||||||
|
|
||||||
fEventMask(0),
|
fEventMask(0),
|
||||||
fEventOptions(0),
|
fEventOptions(0),
|
||||||
@ -845,11 +846,13 @@ ViewLayer::Draw(DrawingEngine* drawingEngine, BRegion* effectiveClipping,
|
|||||||
drawingEngine->FillRegion(redraw, fViewColor);
|
drawingEngine->FillRegion(redraw, fViewColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fBackgroundDirty = false;
|
||||||
|
|
||||||
// let children draw
|
// let children draw
|
||||||
if (deep) {
|
if (deep) {
|
||||||
// before passing the clipping on to children, exclude our
|
// before passing the clipping on to children, exclude our
|
||||||
// own region from the available clipping
|
// own region from the available clipping
|
||||||
effectiveClipping->Exclude(&ScreenClipping(windowContentClipping));
|
effectiveClipping->Exclude(&fScreenClipping);
|
||||||
|
|
||||||
for (ViewLayer* child = FirstChild(); child; child = child->NextSibling()) {
|
for (ViewLayer* child = FirstChild(); child; child = child->NextSibling()) {
|
||||||
child->Draw(drawingEngine, effectiveClipping,
|
child->Draw(drawingEngine, effectiveClipping,
|
||||||
@ -907,6 +910,15 @@ ViewLayer::UpdateVisibleDeep(bool parentVisible)
|
|||||||
child->UpdateVisibleDeep(fVisible);
|
child->UpdateVisibleDeep(fVisible);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MarkBackgroundDirty
|
||||||
|
void
|
||||||
|
ViewLayer::MarkBackgroundDirty()
|
||||||
|
{
|
||||||
|
fBackgroundDirty = true;
|
||||||
|
for (ViewLayer* child = FirstChild(); child; child = child->NextSibling())
|
||||||
|
child->MarkBackgroundDirty();
|
||||||
|
}
|
||||||
|
|
||||||
// PrintToStream
|
// PrintToStream
|
||||||
void
|
void
|
||||||
ViewLayer::PrintToStream() const
|
ViewLayer::PrintToStream() const
|
||||||
|
@ -160,6 +160,10 @@ class ViewLayer {
|
|||||||
// according to the parents visibility
|
// according to the parents visibility
|
||||||
void UpdateVisibleDeep(bool parentVisible);
|
void UpdateVisibleDeep(bool parentVisible);
|
||||||
|
|
||||||
|
void MarkBackgroundDirty();
|
||||||
|
bool IsBackgroundDirty() const
|
||||||
|
{ return fBackgroundDirty; }
|
||||||
|
|
||||||
// clipping
|
// clipping
|
||||||
void RebuildClipping(bool deep);
|
void RebuildClipping(bool deep);
|
||||||
BRegion& ScreenClipping(BRegion* windowContentClipping,
|
BRegion& ScreenClipping(BRegion* windowContentClipping,
|
||||||
@ -189,6 +193,7 @@ class ViewLayer {
|
|||||||
uint32 fFlags;
|
uint32 fFlags;
|
||||||
bool fHidden;
|
bool fHidden;
|
||||||
bool fVisible;
|
bool fVisible;
|
||||||
|
bool fBackgroundDirty;
|
||||||
|
|
||||||
uint32 fEventMask;
|
uint32 fEventMask;
|
||||||
uint32 fEventOptions;
|
uint32 fEventOptions;
|
||||||
|
Loading…
Reference in New Issue
Block a user