diff --git a/gfx/layers/apz/src/APZCTreeManager.cpp b/gfx/layers/apz/src/APZCTreeManager.cpp index 44e2b342490c..3033d516863b 100644 --- a/gfx/layers/apz/src/APZCTreeManager.cpp +++ b/gfx/layers/apz/src/APZCTreeManager.cpp @@ -3357,6 +3357,13 @@ void APZCTreeManager::SendSubtreeTransformsToChromeMainThread( controller->NotifyLayerTransforms(messages); } +void APZCTreeManager::SetFixedLayerMargins(ScreenIntCoord aTop, + ScreenIntCoord aBottom) { + RecursiveMutexAutoLock lock(mTreeLock); + mFixedLayerMargins.top = aTop; + mFixedLayerMargins.bottom = aBottom; +} + /*static*/ LayerToParentLayerMatrix4x4 APZCTreeManager::ComputeTransformForScrollThumb( const LayerToParentLayerMatrix4x4& aCurrentTransform, diff --git a/gfx/layers/apz/src/APZCTreeManager.h b/gfx/layers/apz/src/APZCTreeManager.h index cebed56ebd10..255bb0bd30c9 100644 --- a/gfx/layers/apz/src/APZCTreeManager.h +++ b/gfx/layers/apz/src/APZCTreeManager.h @@ -455,6 +455,11 @@ class APZCTreeManager : public IAPZCTreeManager, public APZInputBridge { void SendSubtreeTransformsToChromeMainThread( const AsyncPanZoomController* aAncestor); + /** + * Set fixed layer margins for dynamic toolbar. + */ + void SetFixedLayerMargins(ScreenIntCoord aTop, ScreenIntCoord aBottom); + /** * Compute the updated shadow transform for a scroll thumb layer that * reflects async scrolling of the associated scroll frame. @@ -863,6 +868,11 @@ class APZCTreeManager : public IAPZCTreeManager, public APZInputBridge { /* Stores the current mouse position in screen coordinates. */ ScreenPoint mCurrentMousePosition; + /* Extra margins that should be applied to content that fixed wrt. the + * RCD-RSF, to account for the dynamic toolbar. + * Acquire mTreeLock before accessing this. + */ + ScreenMargin mFixedLayerMargins; /* For logging the APZC tree for debugging (enabled by the apz.printtree * pref). */ gfx::TreeLog mApzcTreeLog; diff --git a/gfx/layers/ipc/CompositorBridgeParent.cpp b/gfx/layers/ipc/CompositorBridgeParent.cpp index f95a09b21ac1..503455fe6c54 100644 --- a/gfx/layers/ipc/CompositorBridgeParent.cpp +++ b/gfx/layers/ipc/CompositorBridgeParent.cpp @@ -1442,6 +1442,10 @@ void CompositorBridgeParent::SetFixedLayerMargins(ScreenIntCoord aTop, manager->SetFixedLayerMargins(aTop, aBottom); } + if (mApzcTreeManager) { + mApzcTreeManager->SetFixedLayerMargins(aTop, aBottom); + } + Invalidate(); ScheduleComposition(); }