Skip to content

Commit

Permalink
[Code health] Move TickAnimationsIf to anonymous namespace
Browse files Browse the repository at this point in the history
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/+/1604110
Reviewed-by: Yi Gu <yigu@chromium.org>
Reviewed-by: Majid Valipour <majidvp@chromium.org>
Reviewed-by: Stephen McGruer <smcgruer@chromium.org>
Commit-Queue: Xida Chen <xidachen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#659119}
  • Loading branch information
xidachen authored and Commit Bot committed May 13, 2019
1 parent bc50d0e commit 1e1c95f
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions cc/animation/animation_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 1e1c95f

Please sign in to comment.