* renamed _MarkContentDirty() to _TransferToUpdateSession()
to avoid any confusion with MarkContentDirty() * hopyfully fixed all drawing defects that could be observed with CopyBits()ing and ScrollTo()ing, the fix is definitely valid, and I cannot see any more problems in Tracker either... hopefully this is it. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15458 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -462,11 +462,25 @@ WindowLayer::CopyContents(BRegion* region, int32 xOffset, int32 yOffset)
|
||||
// move along the already dirty regions that are common
|
||||
// with the region that we could copy
|
||||
_ShiftPartOfRegion(&fDirtyRegion, region, xOffset, yOffset);
|
||||
if (fCurrentUpdateSession.IsUsed())
|
||||
_ShiftPartOfRegion(&fCurrentUpdateSession.DirtyRegion(), region, xOffset, yOffset);
|
||||
if (fPendingUpdateSession.IsUsed())
|
||||
_ShiftPartOfRegion(&fPendingUpdateSession.DirtyRegion(), region, xOffset, yOffset);
|
||||
|
||||
|
||||
if (fCurrentUpdateSession.IsUsed()) {
|
||||
// if there are parts in the current update session
|
||||
// that intersect with the copied region, we cannot
|
||||
// simply shift them as with the other dirty regions
|
||||
// - we cannot change the update rect already told to the
|
||||
// client, that's why we transfer those parts to the
|
||||
// new dirty region instead
|
||||
BRegion common(*region);
|
||||
// see if there is a common part at all
|
||||
common.IntersectWith(&fCurrentUpdateSession.DirtyRegion());
|
||||
if (common.CountRects() > 0) {
|
||||
// cut the common part from the region
|
||||
fCurrentUpdateSession.DirtyRegion().Exclude(&common);
|
||||
newDirty.Include(&common);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// what is left visible from the original region
|
||||
@@ -1520,7 +1534,7 @@ WindowLayer::_TriggerContentRedraw()
|
||||
|
||||
if (dirtyContentRegion.CountRects() > 0) {
|
||||
// send UPDATE message to the client
|
||||
_MarkContentDirty(&dirtyContentRegion);
|
||||
_TransferToUpdateSession(&dirtyContentRegion);
|
||||
|
||||
if (!fContentRegionValid)
|
||||
_UpdateContentRegion();
|
||||
@@ -1574,7 +1588,7 @@ WindowLayer::_DrawBorder()
|
||||
the clipping lock held
|
||||
*/
|
||||
void
|
||||
WindowLayer::_MarkContentDirty(BRegion* contentDirtyRegion)
|
||||
WindowLayer::_TransferToUpdateSession(BRegion* contentDirtyRegion)
|
||||
{
|
||||
if (contentDirtyRegion->CountRects() <= 0)
|
||||
return;
|
||||
@@ -1606,7 +1620,7 @@ WindowLayer::_MarkContentDirty(BRegion* contentDirtyRegion)
|
||||
// sent the update message!!!
|
||||
} else {
|
||||
if (!fCurrentUpdateSession.IsUsed())
|
||||
fprintf(stderr, "WindowLayer(%s)::_MarkContentDirty() - pending region changed before BeginUpdate()!\n", Title());
|
||||
fprintf(stderr, "WindowLayer(%s)::_TransferToUpdateSession() - pending region changed before BeginUpdate()!\n", Title());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -200,7 +200,7 @@ class WindowLayer {
|
||||
void _DrawBorder();
|
||||
|
||||
// handling update sessions
|
||||
void _MarkContentDirty(BRegion* contentDirtyRegion);
|
||||
void _TransferToUpdateSession(BRegion* contentDirtyRegion);
|
||||
void _SendUpdateMessage();
|
||||
|
||||
void _UpdateContentRegion();
|
||||
|
||||
Reference in New Issue
Block a user