Commit 1e1c95f8 authored by Xida Chen's avatar Xida Chen Committed by Commit Bot

[Code health] Move TickAnimationsIf to anonymous namespace

The TickAnimationsIf is not a member function and is used in the same
file. In this case, it should be in the anonymous namespace.

This CL doesn't introduce any behavior change.

Bug: None
Change-Id: I4cc3340335dfbd8b9c3b50765710d8c46bbda603
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1604110Reviewed-by: default avatarYi Gu <yigu@chromium.org>
Reviewed-by: default avatarMajid Valipour <majidvp@chromium.org>
Reviewed-by: default avatarStephen McGruer <smcgruer@chromium.org>
Commit-Queue: Xida Chen <xidachen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#659119}
parent bc50d0e1
......@@ -47,6 +47,19 @@ AnimationWorkletMutationState ToAnimationWorkletMutationState(
}
}
bool TickAnimationsIf(AnimationHost::AnimationsList animations,
base::TimeTicks monotonic_time,
bool (*predicate)(const Animation&)) {
bool did_tick = false;
for (auto& it : animations) {
if (predicate(*it)) {
it->Tick(monotonic_time);
did_tick = true;
}
}
return did_tick;
}
} // namespace
std::unique_ptr<AnimationHost> AnimationHost::CreateMainInstance() {
......@@ -356,19 +369,6 @@ bool AnimationHost::ActivateAnimations() {
return true;
}
bool TickAnimationsIf(AnimationHost::AnimationsList animations,
base::TimeTicks monotonic_time,
bool (*predicate)(const Animation&)) {
bool did_tick = false;
for (auto& it : animations) {
if (predicate(*it)) {
it->Tick(monotonic_time);
did_tick = true;
}
}
return did_tick;
}
bool AnimationHost::TickAnimations(base::TimeTicks monotonic_time,
const ScrollTree& scroll_tree,
bool is_active_tree) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment