Bug 1567889 - Part 2: Avoid will-change budget lookups if the frame does not have the will-change bit set r=mattwoodrow

Differential Revision: https://phabricator.services.mozilla.com/D38852

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Miko Mynttinen 2019-10-28 14:11:26 +00:00
Родитель ccab3f6249
Коммит 5ffddb5a57
2 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -3895,7 +3895,6 @@ void nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
}
nsIFrame* child = aChild;
aBuilder->RemoveFromWillChangeBudget(child);
const bool isPaintingToWindow = aBuilder->IsPaintingToWindow();
const bool doingShortcut =
@ -3904,6 +3903,8 @@ void nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
// Animations may change the stacking context state.
!(child->MayHaveTransformAnimation() || child->MayHaveOpacityAnimation());
aBuilder->RemoveFromWillChangeBudget(child);
if (StaticPrefs::layout_css_scroll_anchoring_highlight()) {
if (child->FirstContinuation()->IsScrollAnchor()) {
nsRect bounds = child->GetContentRectRelativeToSelf() +

Просмотреть файл

@ -2549,6 +2549,11 @@ bool nsDisplayListBuilder::IsInWillChangeBudget(nsIFrame* aFrame,
}
void nsDisplayListBuilder::RemoveFromWillChangeBudget(nsIFrame* aFrame) {
if (!aFrame->MayHaveWillChangeBudget()) {
MOZ_ASSERT(!mWillChangeBudgetSet.Contains(aFrame));
return;
}
FrameWillChangeBudget* frameBudget = mWillChangeBudgetSet.GetValue(aFrame);
if (!frameBudget) {