Bug 1253860 - Stop APZC from reprocessing stale metrics on unrelated layer tree updates. r=botond

MozReview-Commit-ID: 5JM83cngdVy
This commit is contained in:
Kartikaya Gupta 2016-03-09 22:57:14 -05:00
Родитель 94597a131a
Коммит 419b25a231
1 изменённых файлов: 10 добавлений и 0 удалений

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

@ -3254,6 +3254,16 @@ void AsyncPanZoomController::NotifyLayersUpdated(const FrameMetrics& aLayerMetri
ReentrantMonitorAutoEnter lock(mMonitor);
bool isDefault = mFrameMetrics.IsDefault();
if (!aThisLayerTreeUpdated && !isDefault) {
// No new information here, skip it. Note that this is not just an
// optimization; it's correctness too. In the case where we get one of these
// stale aLayerMetrics *after* a call to UpdateScrollOffset, processing the
// stale aLayerMetrics would clobber the more up-to-date information from
// UpdateScrollOffset.
MOZ_ASSERT(aLayerMetrics == mLastContentPaintMetrics);
APZC_LOG("%p NotifyLayersUpdated short-circuit\n", this);
return;
}
mLastContentPaintMetrics = aLayerMetrics;
mFrameMetrics.SetScrollParentId(aLayerMetrics.GetScrollParentId());