mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1201277 - Replace functors with lambdas in APZCTreeManager. r=botond
This commit is contained in:
parent
2e31ac5e25
commit
a7197dcda6
@ -1548,17 +1548,13 @@ APZCTreeManager::FindRootApzcForLayersId(uint64_t aLayersId) const
|
||||
{
|
||||
mTreeLock.AssertCurrentThreadOwns();
|
||||
|
||||
struct RootForLayersIdMatcher {
|
||||
uint64_t mLayersId;
|
||||
bool operator()(const HitTestingTreeNode* aNode) const {
|
||||
AsyncPanZoomController* apzc = aNode->GetApzc();
|
||||
return apzc
|
||||
&& apzc->GetLayersId() == mLayersId
|
||||
&& apzc->IsRootForLayersId();
|
||||
}
|
||||
};
|
||||
const HitTestingTreeNode* resultNode = BreadthFirstSearch(mRootNode.get(),
|
||||
RootForLayersIdMatcher{aLayersId});
|
||||
[aLayersId](const HitTestingTreeNode* aNode) {
|
||||
AsyncPanZoomController* apzc = aNode->GetApzc();
|
||||
return apzc
|
||||
&& apzc->GetLayersId() == aLayersId
|
||||
&& apzc->IsRootForLayersId();
|
||||
});
|
||||
return resultNode ? resultNode->GetApzc() : nullptr;
|
||||
}
|
||||
|
||||
@ -1567,17 +1563,13 @@ 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});
|
||||
[aLayersId](const HitTestingTreeNode* aNode) {
|
||||
AsyncPanZoomController* apzc = aNode->GetApzc();
|
||||
return apzc
|
||||
&& apzc->GetLayersId() == aLayersId
|
||||
&& apzc->IsRootContent();
|
||||
});
|
||||
return resultNode ? resultNode->GetApzc() : nullptr;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user