diff --git a/src/tests/servers/app/newerClipping/ClientLooper.cpp b/src/tests/servers/app/newerClipping/ClientLooper.cpp index 94372a18c3..20d8148586 100644 --- a/src/tests/servers/app/newerClipping/ClientLooper.cpp +++ b/src/tests/servers/app/newerClipping/ClientLooper.cpp @@ -38,7 +38,7 @@ ClientLooper::MessageReceived(BMessage* message) for (int32 i = 0; i < fViewCount; i++) { // the client is slow - snooze(20000L); +// snooze(40000L); // send the command to redraw a view BMessage command(MSG_DRAWING_COMMAND); command.AddInt32("token", i); diff --git a/src/tests/servers/app/newerClipping/Desktop.cpp b/src/tests/servers/app/newerClipping/Desktop.cpp index a27e040f51..b4b25ebf7c 100644 --- a/src/tests/servers/app/newerClipping/Desktop.cpp +++ b/src/tests/servers/app/newerClipping/Desktop.cpp @@ -539,6 +539,7 @@ Desktop::MarkDirty(BRegion* region) // add the new dirty region to the culmulative dirty region fDirtyRegion.Include(region); +#if SHOW_GLOBAL_DIRTY_REGION if (fDrawingEngine->Lock()) { fDrawingEngine->SetHighColor(255, 0, 0); fDrawingEngine->FillRegion(region); @@ -546,6 +547,7 @@ if (fDrawingEngine->Lock()) { fDrawingEngine->Unlock(); snooze(100000); } +#endif // send redraw messages to all windows intersecting the dirty region _TriggerWindowRedrawing(region); diff --git a/src/tests/servers/app/newerClipping/Desktop.h b/src/tests/servers/app/newerClipping/Desktop.h index e085f65116..bc2e6f7dd5 100644 --- a/src/tests/servers/app/newerClipping/Desktop.h +++ b/src/tests/servers/app/newerClipping/Desktop.h @@ -19,6 +19,8 @@ enum { }; #define MULTI_LOCKER 0 +#define SHOW_GLOBAL_DIRTY_REGION 0 +#define SHOW_WINDOW_CONTENT_DIRTY_REGION 0 class Desktop : public BLooper { public: diff --git a/src/tests/servers/app/newerClipping/WindowLayer.cpp b/src/tests/servers/app/newerClipping/WindowLayer.cpp index 3b6ba5d58e..0b33c10d8f 100644 --- a/src/tests/servers/app/newerClipping/WindowLayer.cpp +++ b/src/tests/servers/app/newerClipping/WindowLayer.cpp @@ -322,6 +322,8 @@ WindowLayer::_DrawContents(ViewLayer* layer) dirtyContentRegion.IntersectWith(fDesktop->DirtyRegion()); if (dirtyContentRegion.CountRects() > 0) { + +#if SHOW_WINDOW_CONTENT_DIRTY_REGION if (fDrawingEngine->Lock()) { fDrawingEngine->SetHighColor(0, 0, 255); fDrawingEngine->FillRegion(&dirtyContentRegion); @@ -329,7 +331,7 @@ if (fDrawingEngine->Lock()) { fDrawingEngine->Unlock(); snooze(100000); } - +#endif // send UPDATE message to the client _MarkContentDirty(&dirtyContentRegion); @@ -435,6 +437,14 @@ WindowLayer::_MarkContentDirty(BRegion* contentDirtyRegion) fPendingUpdateSession->Include(contentDirtyRegion); } + // clip pending update session from current, + // current update session, because the backgrounds have been + // cleared again already + if (fCurrentUpdateSession) { + fCurrentUpdateSession->Exclude(contentDirtyRegion); + fEffectiveDrawingRegionValid = false; + } + if (!fUpdateRequested) { // send this to client fClient->PostMessage(MSG_UPDATE); @@ -456,6 +466,7 @@ WindowLayer::_BeginUpdate() // session enforced fInUpdate = true; } + fEffectiveDrawingRegionValid = false; } } @@ -468,6 +479,7 @@ WindowLayer::_EndUpdate() fCurrentUpdateSession = NULL; fInUpdate = false; + fEffectiveDrawingRegionValid = false; } if (fPendingUpdateSession) { // send this to client @@ -498,6 +510,13 @@ UpdateSession::Include(BRegion* additionalDirty) fDirtyRegion.Include(additionalDirty); } +// Exclude +void +UpdateSession::Exclude(BRegion* dirtyInNextSession) +{ + fDirtyRegion.Exclude(dirtyInNextSession); +} + // MoveBy void UpdateSession::MoveBy(int32 x, int32 y) diff --git a/src/tests/servers/app/newerClipping/WindowLayer.h b/src/tests/servers/app/newerClipping/WindowLayer.h index ef169527a3..9a78648c98 100644 --- a/src/tests/servers/app/newerClipping/WindowLayer.h +++ b/src/tests/servers/app/newerClipping/WindowLayer.h @@ -27,6 +27,7 @@ class UpdateSession { virtual ~UpdateSession(); void Include(BRegion* additionalDirty); + void Exclude(BRegion* dirtyInNextSession); inline BRegion& DirtyRegion() { return fDirtyRegion; }