Remove redundant parameter from ShadowTreeRegistry::enumerate
Summary: Changelog: [internal] Nothing was using `stop` parameter, let's get rid of it. Reviewed By: philIip Differential Revision: D32669018 fbshipit-source-id: dc2d52048a2f7dd3785dd959270087001c778962
This commit is contained in:
Родитель
fab4752e1f
Коммит
a9815286c2
|
@ -53,15 +53,10 @@ bool ShadowTreeRegistry::visit(
|
|||
}
|
||||
|
||||
void ShadowTreeRegistry::enumerate(
|
||||
std::function<void(const ShadowTree &shadowTree, bool &stop)> callback)
|
||||
const {
|
||||
std::function<void(const ShadowTree &shadowTree)> callback) const {
|
||||
std::shared_lock<better::shared_mutex> lock(mutex_);
|
||||
bool stop = false;
|
||||
for (auto const &pair : registry_) {
|
||||
callback(*pair.second, stop);
|
||||
if (stop) {
|
||||
break;
|
||||
}
|
||||
callback(*pair.second);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -54,11 +54,10 @@ class ShadowTreeRegistry final {
|
|||
|
||||
/*
|
||||
* Enumerates all stored shadow trees.
|
||||
* Set `stop` to `true` to interrupt the enumeration.
|
||||
* Can be called from any thread.
|
||||
*/
|
||||
void enumerate(std::function<void(const ShadowTree &shadowTree, bool &stop)>
|
||||
callback) const;
|
||||
void enumerate(
|
||||
std::function<void(const ShadowTree &shadowTree)> callback) const;
|
||||
|
||||
private:
|
||||
mutable better::shared_mutex mutex_;
|
||||
|
|
|
@ -143,7 +143,7 @@ Scheduler::~Scheduler() {
|
|||
// Then, let's verify that the requirement was satisfied.
|
||||
auto surfaceIds = std::vector<SurfaceId>{};
|
||||
uiManager_->getShadowTreeRegistry().enumerate(
|
||||
[&](ShadowTree const &shadowTree, bool &stop) {
|
||||
[&surfaceIds](ShadowTree const &shadowTree) {
|
||||
surfaceIds.push_back(shadowTree.getSurfaceId());
|
||||
});
|
||||
|
||||
|
|
|
@ -449,10 +449,9 @@ void UIManager::stopSurfaceForAnimationDelegate(SurfaceId surfaceId) const {
|
|||
void UIManager::animationTick() {
|
||||
if (animationDelegate_ != nullptr &&
|
||||
animationDelegate_->shouldAnimateFrame()) {
|
||||
shadowTreeRegistry_.enumerate(
|
||||
[&](ShadowTree const &shadowTree, bool &stop) {
|
||||
shadowTree.notifyDelegatesOfUpdates();
|
||||
});
|
||||
shadowTreeRegistry_.enumerate([](ShadowTree const &shadowTree) {
|
||||
shadowTree.notifyDelegatesOfUpdates();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче