From 3c0e5f8e8b8244669653817fa433394d1f6d48ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Tue, 20 Dec 2005 22:31:42 +0000 Subject: [PATCH] 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 --- src/servers/app/ViewLayer.cpp | 14 +++++++++++++- src/servers/app/ViewLayer.h | 5 +++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/servers/app/ViewLayer.cpp b/src/servers/app/ViewLayer.cpp index 2b21ac47b1..98c4e7a3cf 100644 --- a/src/servers/app/ViewLayer.cpp +++ b/src/servers/app/ViewLayer.cpp @@ -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 diff --git a/src/servers/app/ViewLayer.h b/src/servers/app/ViewLayer.h index 49c790f313..2a9e788caf 100644 --- a/src/servers/app/ViewLayer.h +++ b/src/servers/app/ViewLayer.h @@ -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;