Bug 1552608 - Store fixed layer margins in APZCTreeManager. r=tnikkel

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Botond Ballo 2019-10-07 20:44:29 +00:00
parent 89a90da007
commit 5f774c598e
3 changed files with 21 additions and 0 deletions

View File

@ -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,

View File

@ -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<gfx::LOG_DEFAULT> mApzcTreeLog;

View File

@ -1442,6 +1442,10 @@ void CompositorBridgeParent::SetFixedLayerMargins(ScreenIntCoord aTop,
manager->SetFixedLayerMargins(aTop, aBottom);
}
if (mApzcTreeManager) {
mApzcTreeManager->SetFixedLayerMargins(aTop, aBottom);
}
Invalidate();
ScheduleComposition();
}