mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 1367837 - Expose a testing helper method to get an APZC instance from the layers id and scroll id. r=botond
MozReview-Commit-ID: HyEMamx7nDk
This commit is contained in:
parent
71133b7ca0
commit
f47534e48a
@ -1802,6 +1802,25 @@ APZCTreeManager::GetTargetAPZC(const ScrollableLayerGuid& aGuid)
|
||||
return apzc.forget();
|
||||
}
|
||||
|
||||
static bool
|
||||
GuidComparatorIgnoringPresShell(const ScrollableLayerGuid& aOne, const ScrollableLayerGuid& aTwo)
|
||||
{
|
||||
return aOne.mLayersId == aTwo.mLayersId
|
||||
&& aOne.mScrollId == aTwo.mScrollId;
|
||||
}
|
||||
|
||||
already_AddRefed<AsyncPanZoomController>
|
||||
APZCTreeManager::GetTargetAPZC(const uint64_t& aLayersId,
|
||||
const FrameMetrics::ViewID& aScrollId)
|
||||
{
|
||||
MutexAutoLock lock(mTreeLock);
|
||||
ScrollableLayerGuid guid(aLayersId, 0, aScrollId);
|
||||
RefPtr<HitTestingTreeNode> node = GetTargetNode(guid, &GuidComparatorIgnoringPresShell);
|
||||
MOZ_ASSERT(!node || node->GetApzc()); // any node returned must have an APZC
|
||||
RefPtr<AsyncPanZoomController> apzc = node ? node->GetApzc() : nullptr;
|
||||
return apzc.forget();
|
||||
}
|
||||
|
||||
already_AddRefed<HitTestingTreeNode>
|
||||
APZCTreeManager::GetTargetNode(const ScrollableLayerGuid& aGuid,
|
||||
GuidComparator aComparator) const
|
||||
@ -1842,13 +1861,6 @@ APZCTreeManager::GetTargetAPZC(const ScreenPoint& aPoint,
|
||||
return target.forget();
|
||||
}
|
||||
|
||||
static bool
|
||||
GuidComparatorIgnoringPresShell(const ScrollableLayerGuid& aOne, const ScrollableLayerGuid& aTwo)
|
||||
{
|
||||
return aOne.mLayersId == aTwo.mLayersId
|
||||
&& aOne.mScrollId == aTwo.mScrollId;
|
||||
}
|
||||
|
||||
RefPtr<const OverscrollHandoffChain>
|
||||
APZCTreeManager::BuildOverscrollHandoffChain(const RefPtr<AsyncPanZoomController>& aInitialTarget)
|
||||
{
|
||||
|
@ -459,6 +459,8 @@ public:
|
||||
already_AddRefed<AsyncPanZoomController> GetTargetAPZC(const ScreenPoint& aPoint,
|
||||
HitTestResult* aOutHitResult,
|
||||
HitTestingTreeNode** aOutScrollbarNode = nullptr);
|
||||
already_AddRefed<AsyncPanZoomController> GetTargetAPZC(const uint64_t& aLayersId,
|
||||
const FrameMetrics::ViewID& aScrollId);
|
||||
ScreenToParentLayerMatrix4x4 GetScreenToApzcTransform(const AsyncPanZoomController *aApzc) const;
|
||||
ParentLayerToScreenMatrix4x4 GetApzcToGeckoTransform(const AsyncPanZoomController *aApzc) const;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user