Bug 1927375. Optimize relatively slow IsFixedPosFrameInDisplayPort call in OutOfFlowDisplayData::ComputeVisibleRectForFrame. r=gfx-reviewers,aosmond
IsFixedPosFrameInDisplayPort is relatively slow here taking basically all of the time in evaluating this if condition, the other ones are just checking bools basically. This is a good opportunity for optimization because IsPaintingToWindow is false relatively often (for hit testing and drawing svg iamges) and inPartialUpdate is also false relatively often. Differential Revision: https://phabricator.services.mozilla.com/D227003
This commit is contained in:
@@ -505,9 +505,9 @@ nsRect nsDisplayListBuilder::OutOfFlowDisplayData::ComputeVisibleRectForFrame(
|
||||
|
||||
bool inPartialUpdate =
|
||||
aBuilder->IsRetainingDisplayList() && aBuilder->IsPartialUpdate();
|
||||
if (StaticPrefs::apz_allow_zooming() &&
|
||||
DisplayPortUtils::IsFixedPosFrameInDisplayPort(aFrame) &&
|
||||
aBuilder->IsPaintingToWindow() && !inPartialUpdate) {
|
||||
if (MOZ_LIKELY(StaticPrefs::apz_allow_zooming()) &&
|
||||
aBuilder->IsPaintingToWindow() && !inPartialUpdate &&
|
||||
DisplayPortUtils::IsFixedPosFrameInDisplayPort(aFrame)) {
|
||||
dirtyRectRelativeToDirtyFrame =
|
||||
nsRect(nsPoint(0, 0), aFrame->GetParent()->GetSize());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user