Bug 1541644 - Allow immediate handoff if APZC's displacement is not a user visible amount. r=botond

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Kartikaya Gupta 2019-04-10 20:48:29 +00:00
Родитель 94818bc0da
Коммит 1535d36477
1 изменённых файлов: 22 добавлений и 1 удалений

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

@ -3142,7 +3142,28 @@ bool AsyncPanZoomController::AttemptScroll(
} }
} }
#endif #endif
block->SetScrolledApzc(this); bool displacementIsUserVisible = true;
{ // Release the APZC lock before calling ToScreenCoordinates which
// acquires the APZ tree lock. Note that this just unlocks the mutex
// once, so if we're locking it multiple times on the callstack then
// this will be insufficient.
RecursiveMutexAutoUnlock unlock(mRecursiveMutex);
ScreenIntPoint screenDisplacement = RoundedToInt(
ToScreenCoordinates(adjustedDisplacement, aStartPoint));
// If the displacement we just applied rounds to zero in screen space,
// then it's probably not going to be visible to the user. In that
// case let's not mark this APZC as scrolled, so that even if the
// immediate handoff pref is disabled, we'll allow doing the handoff
// to the next APZC.
if (screenDisplacement == ScreenIntPoint()) {
displacementIsUserVisible = false;
}
}
if (displacementIsUserVisible) {
block->SetScrolledApzc(this);
}
} }
ScheduleCompositeAndMaybeRepaint(); ScheduleCompositeAndMaybeRepaint();
UpdateSharedCompositorFrameMetrics(); UpdateSharedCompositorFrameMetrics();