Bug 1485314 - Only advance animations in SampleForWebRender() after all async transforms have been sampled. r=kats

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Botond Ballo 2018-08-31 20:08:38 +00:00
Родитель 4440463c5d
Коммит 3173b0cdd2
1 изменённых файлов: 10 добавлений и 2 удалений

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

@ -598,7 +598,7 @@ APZCTreeManager::SampleForWebRender(wr::TransactionWrapper& aTxn,
AssertOnSamplerThread();
MutexAutoLock lock(mMapLock);
bool activeAnimations = false;
// Sample async transforms on scrollable layers.
for (const auto& mapping : mApzcMap) {
AsyncPanZoomController* apzc = mapping.second;
@ -621,7 +621,6 @@ APZCTreeManager::SampleForWebRender(wr::TransactionWrapper& aTxn,
wr::ToLayoutPoint(LayoutDevicePoint::FromUnknownPoint(asyncScrollDelta.ToUnknownPoint())));
apzc->ReportCheckerboard(aSampleTime);
activeAnimations |= apzc->AdvanceAnimations(aSampleTime);
}
// Now collect all the async transforms needed for the scrollthumbs.
@ -654,6 +653,15 @@ APZCTreeManager::SampleForWebRender(wr::TransactionWrapper& aTxn,
}
aTxn.AppendTransformProperties(scrollbarTransforms);
// Advance animations. It's important that this happens after
// sampling all async transforms, because AdvanceAnimations() updates
// the effective scroll offset to the value it should have for the *next*
// composite after this one (if the APZ frame delay is enabled).
bool activeAnimations = false;
for (const auto& mapping : mApzcMap) {
AsyncPanZoomController* apzc = mapping.second;
activeAnimations |= apzc->AdvanceAnimations(aSampleTime);
}
if (activeAnimations) {
RefPtr<CompositorController> controller;
CompositorBridgeParent::CallWithIndirectShadowTree(mRootLayersId,