Bug 1158424 - Add APZCTreeManager::FindRootContentApzcForLayersId(). r=kats

This commit is contained in:
Botond Ballo 2015-06-10 14:48:03 -04:00
parent d9d2910535
commit 711c9d3110
2 changed files with 20 additions and 0 deletions

View File

@ -1531,6 +1531,25 @@ APZCTreeManager::FindRootApzcForLayersId(uint64_t aLayersId) const
return resultNode ? resultNode->GetApzc() : nullptr;
}
AsyncPanZoomController*
APZCTreeManager::FindRootContentApzcForLayersId(uint64_t aLayersId) const
{
mTreeLock.AssertCurrentThreadOwns();
struct RootContentForLayersIdMatcher {
uint64_t mLayersId;
bool operator()(const HitTestingTreeNode* aNode) const {
AsyncPanZoomController* apzc = aNode->GetApzc();
return apzc
&& apzc->GetLayersId() == mLayersId
&& apzc->IsRootContent();
}
};
const HitTestingTreeNode* resultNode = BreadthFirstSearch(mRootNode.get(),
RootContentForLayersIdMatcher{aLayersId});
return resultNode ? resultNode->GetApzc() : nullptr;
}
/* The methods GetScreenToApzcTransform() and GetApzcToGeckoTransform() return
some useful transformations that input events may need applied. This is best
illustrated with an example. Consider a chain of layers, L, M, N, O, P, Q, R. Layer L

View File

@ -413,6 +413,7 @@ private:
const ParentLayerPoint& aHitTestPoint,
HitTestResult* aOutHitResult);
AsyncPanZoomController* FindRootApzcForLayersId(uint64_t aLayersId) const;
AsyncPanZoomController* FindRootContentApzcForLayersId(uint64_t aLayersId) const;
already_AddRefed<AsyncPanZoomController> GetMultitouchTarget(AsyncPanZoomController* aApzc1, AsyncPanZoomController* aApzc2) const;
already_AddRefed<AsyncPanZoomController> CommonAncestor(AsyncPanZoomController* aApzc1, AsyncPanZoomController* aApzc2) const;
already_AddRefed<AsyncPanZoomController> RootAPZCForLayersId(AsyncPanZoomController* aApzc) const;