this fixes the bugs in the update session region enforcement during client drawing, there is only one bug left now: resized ViewLayers don't invalidate the correct regions (they don't take areas into account that are hidden because the parent is too small)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15168 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
df36243372
commit
f5552ed0b2
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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:
|
||||
|
@ -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)
|
||||
|
@ -27,6 +27,7 @@ class UpdateSession {
|
||||
virtual ~UpdateSession();
|
||||
|
||||
void Include(BRegion* additionalDirty);
|
||||
void Exclude(BRegion* dirtyInNextSession);
|
||||
|
||||
inline BRegion& DirtyRegion()
|
||||
{ return fDirtyRegion; }
|
||||
|
Loading…
Reference in New Issue
Block a user