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
|
||||
fHidden(false),
|
||||
fVisible(true),
|
||||
fBackgroundDirty(true),
|
||||
|
||||
fEventMask(0),
|
||||
fEventOptions(0),
|
||||
@ -845,11 +846,13 @@ ViewLayer::Draw(DrawingEngine* drawingEngine, BRegion* effectiveClipping,
|
||||
drawingEngine->FillRegion(redraw, fViewColor);
|
||||
}
|
||||
|
||||
fBackgroundDirty = false;
|
||||
|
||||
// let children draw
|
||||
if (deep) {
|
||||
// before passing the clipping on to children, exclude our
|
||||
// own region from the available clipping
|
||||
effectiveClipping->Exclude(&ScreenClipping(windowContentClipping));
|
||||
effectiveClipping->Exclude(&fScreenClipping);
|
||||
|
||||
for (ViewLayer* child = FirstChild(); child; child = child->NextSibling()) {
|
||||
child->Draw(drawingEngine, effectiveClipping,
|
||||
@ -907,6 +910,15 @@ ViewLayer::UpdateVisibleDeep(bool parentVisible)
|
||||
child->UpdateVisibleDeep(fVisible);
|
||||
}
|
||||
|
||||
// MarkBackgroundDirty
|
||||
void
|
||||
ViewLayer::MarkBackgroundDirty()
|
||||
{
|
||||
fBackgroundDirty = true;
|
||||
for (ViewLayer* child = FirstChild(); child; child = child->NextSibling())
|
||||
child->MarkBackgroundDirty();
|
||||
}
|
||||
|
||||
// PrintToStream
|
||||
void
|
||||
ViewLayer::PrintToStream() const
|
||||
|
@ -160,6 +160,10 @@ class ViewLayer {
|
||||
// according to the parents visibility
|
||||
void UpdateVisibleDeep(bool parentVisible);
|
||||
|
||||
void MarkBackgroundDirty();
|
||||
bool IsBackgroundDirty() const
|
||||
{ return fBackgroundDirty; }
|
||||
|
||||
// clipping
|
||||
void RebuildClipping(bool deep);
|
||||
BRegion& ScreenClipping(BRegion* windowContentClipping,
|
||||
@ -189,6 +193,7 @@ class ViewLayer {
|
||||
uint32 fFlags;
|
||||
bool fHidden;
|
||||
bool fVisible;
|
||||
bool fBackgroundDirty;
|
||||
|
||||
uint32 fEventMask;
|
||||
uint32 fEventOptions;
|
||||
|
Loading…
Reference in New Issue
Block a user