commit 7adaf54896c4186b448df89c85a381a2922b44ea parent 856977b3ed32805d992f62c7bdb1497288a63c84 Author: Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com> Date: Mon, 8 Dec 2025 21:39:57 +0000 Bug 2003706 - Use AsyncPanZoomController::mCompositorFixedLayerMargins for the bug 1993407 case. r=botond Differential Revision: https://phabricator.services.mozilla.com/D274871 Diffstat:
| M | gfx/layers/apz/src/AsyncPanZoomController.cpp | | | 16 | ++++------------ |
1 file changed, 4 insertions(+), 12 deletions(-)
diff --git a/gfx/layers/apz/src/AsyncPanZoomController.cpp b/gfx/layers/apz/src/AsyncPanZoomController.cpp @@ -5531,20 +5531,11 @@ void AsyncPanZoomController::NotifyLayersUpdated( LayersUpdateFlags aLayersUpdateFlags) { AssertOnUpdaterThread(); - const FrameMetrics& aLayerMetrics = aScrollMetadata.GetMetrics(); - ScreenMargin fixedLayerMargins; - // Get the fixed layers margins for if the new data is the root content one. - // NOTE: This needs to be done before obtaining |mRecursiveMutex| below to - // respect the APZ lock ordering principle. - if (aLayerMetrics.IsRootContent()) { - if (APZCTreeManager* treeManagerLocal = GetApzcTreeManager()) { - fixedLayerMargins = treeManagerLocal->GetCompositorFixedLayerMargins(); - } - } - RecursiveMutexAutoLock lock(mRecursiveMutex); bool isDefault = mScrollMetadata.IsDefault(); + const FrameMetrics& aLayerMetrics = aScrollMetadata.GetMetrics(); + if ((aScrollMetadata == mLastContentPaintMetadata) && !isDefault) { // No new information here, skip it. APZC_LOGV("%p NotifyLayersUpdated short-circuit\n", this); @@ -6139,7 +6130,8 @@ void AsyncPanZoomController::NotifyLayersUpdated( // So we pass the compositor fixed layers margins which is representing the // dynamic toolbar state to RecalculateLayoutViewportOffset to avoid such // unintentional layout offset changes. - Metrics().RecalculateLayoutViewportOffset(fixedLayerMargins.bottom); + Metrics().RecalculateLayoutViewportOffset( + GetFixedLayerMargins(lock).bottom); mExpectedGeckoMetrics.UpdateFrom(aLayerMetrics); if (ShouldCancelAnimationForScrollUpdate(Nothing())) { CancelAnimation();