mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 539356 - Part 18 - Mark frames with only invalid children as an optimization to use when invalidating further frames. r=roc
This commit is contained in:
parent
fc782c15da
commit
dbca7f19d8
@ -4597,6 +4597,12 @@ void
|
||||
nsIFrame::InvalidateFrameSubtree(PRUint32 aFlags)
|
||||
{
|
||||
InvalidateFrame(aFlags);
|
||||
|
||||
if (HasAnyStateBits(NS_FRAME_ALL_DESCENDANTS_NEED_PAINT)) {
|
||||
return;
|
||||
}
|
||||
|
||||
AddStateBits(NS_FRAME_ALL_DESCENDANTS_NEED_PAINT);
|
||||
|
||||
nsAutoTArray<nsIFrame::ChildList,4> childListArray;
|
||||
GetCrossDocChildLists(&childListArray);
|
||||
@ -4627,7 +4633,9 @@ nsIFrame::ClearInvalidationStateBits()
|
||||
}
|
||||
}
|
||||
|
||||
RemoveStateBits(NS_FRAME_NEEDS_PAINT | NS_FRAME_DESCENDANT_NEEDS_PAINT);
|
||||
RemoveStateBits(NS_FRAME_NEEDS_PAINT |
|
||||
NS_FRAME_DESCENDANT_NEEDS_PAINT |
|
||||
NS_FRAME_ALL_DESCENDANTS_NEED_PAINT);
|
||||
}
|
||||
|
||||
void
|
||||
@ -7784,6 +7792,13 @@ nsFrame::SetParent(nsIFrame* aParent)
|
||||
} else {
|
||||
RemoveInPopupStateBitFromDescendants(this);
|
||||
}
|
||||
|
||||
// If our new parent only has invalid children, then we just invalidate
|
||||
// ourselves too. This is probably faster than clearing the flag all
|
||||
// the way up the frame tree.
|
||||
if (aParent->HasAnyStateBits(NS_FRAME_ALL_DESCENDANTS_NEED_PAINT)) {
|
||||
InvalidateFrame(INVALIDATE_DONT_SCHEDULE_PAINT);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -286,8 +286,14 @@ typedef PRUint64 nsFrameState;
|
||||
// cross-doc children.
|
||||
#define NS_FRAME_DESCENDANT_NEEDS_PAINT NS_FRAME_STATE_BIT(46)
|
||||
|
||||
// Frame has only descendant frames that needs painting - This includes
|
||||
// cross-doc children. This guarantees that all descendents have
|
||||
// NS_FRAME_NEEDS_PAINT and NS_FRAME_ALL_DESCENDANTS_NEED_PAINT, or they
|
||||
// have no display items.
|
||||
#define NS_FRAME_ALL_DESCENDANTS_NEED_PAINT NS_FRAME_STATE_BIT(47)
|
||||
|
||||
// Frame is a descendant of a popup
|
||||
#define NS_FRAME_IN_POPUP NS_FRAME_STATE_BIT(47)
|
||||
#define NS_FRAME_IN_POPUP NS_FRAME_STATE_BIT(48)
|
||||
|
||||
// Box layout bits
|
||||
#define NS_STATE_IS_HORIZONTAL NS_FRAME_STATE_BIT(22)
|
||||
|
Loading…
Reference in New Issue
Block a user