mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 00:05:36 +00:00
Bug 1253860 - Stop APZC from reprocessing stale metrics on unrelated layer tree updates. r=botond
MozReview-Commit-ID: 5JM83cngdVy
This commit is contained in:
parent
94597a131a
commit
419b25a231
@ -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());
|
||||
|
Loading…
Reference in New Issue
Block a user