Commit 7bed7431 authored by Yi Gu's avatar Yi Gu Committed by Commit Bot

[Code Health] Cleanup some ScrollAnimator members

This patch removes one unused override function and makes some variables
private.

Bug: None
Change-Id: Iffe10827abd4ef5fcbccc70393fa6d4167f223df
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1711975Reviewed-by: default avatarDavid Bokan <bokan@chromium.org>
Commit-Queue: Yi Gu <yigu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#680178}
parent 1a9ad253
...@@ -431,27 +431,6 @@ void ScrollAnimator::NotifyCompositorAnimationFinished(int group_id) { ...@@ -431,27 +431,6 @@ void ScrollAnimator::NotifyCompositorAnimationFinished(int group_id) {
std::move(on_finish_).Run(); std::move(on_finish_).Run();
} }
void ScrollAnimator::NotifyAnimationTakeover(
double monotonic_time,
double animation_start_time,
std::unique_ptr<cc::AnimationCurve> curve) {
// If there is already an animation running and the compositor asks to take
// over an animation, do nothing to avoid judder.
if (HasRunningAnimation())
return;
cc::ScrollOffsetAnimationCurve* scroll_offset_animation_curve =
curve->ToScrollOffsetAnimationCurve();
ScrollOffset target_value(scroll_offset_animation_curve->target_value().x(),
scroll_offset_animation_curve->target_value().y());
if (WillAnimateToOffset(target_value)) {
animation_curve_ = std::make_unique<CompositorScrollOffsetAnimationCurve>(
scroll_offset_animation_curve);
start_time_ =
base::TimeTicks() + base::TimeDelta::FromSecondsD(animation_start_time);
}
}
void ScrollAnimator::CancelAnimation() { void ScrollAnimator::CancelAnimation() {
ScrollAnimatorCompositorCoordinator::CancelAnimation(); ScrollAnimatorCompositorCoordinator::CancelAnimation();
if (on_finish_) if (on_finish_)
......
...@@ -137,14 +137,6 @@ class CORE_EXPORT ScrollAnimator : public ScrollAnimatorBase { ...@@ -137,14 +137,6 @@ class CORE_EXPORT ScrollAnimator : public ScrollAnimatorBase {
// Returns whether or not the animation was sent to the compositor. // Returns whether or not the animation was sent to the compositor.
virtual bool SendAnimationToCompositor(); virtual bool SendAnimationToCompositor();
void NotifyAnimationTakeover(double monotonic_time,
double animation_start_time,
std::unique_ptr<cc::AnimationCurve>) override;
std::unique_ptr<CompositorScrollOffsetAnimationCurve> animation_curve_;
const base::TickClock* const tick_clock_;
base::TimeTicks start_time_;
private: private:
// Returns true if the animation was scheduled successfully. If animation // Returns true if the animation was scheduled successfully. If animation
// could not be scheduled (e.g. because the frame is detached), scrolls // could not be scheduled (e.g. because the frame is detached), scrolls
...@@ -162,6 +154,10 @@ class CORE_EXPORT ScrollAnimator : public ScrollAnimatorBase { ...@@ -162,6 +154,10 @@ class CORE_EXPORT ScrollAnimator : public ScrollAnimatorBase {
// because we are already at targetPos. // because we are already at targetPos.
bool WillAnimateToOffset(const ScrollOffset& target_pos); bool WillAnimateToOffset(const ScrollOffset& target_pos);
std::unique_ptr<CompositorScrollOffsetAnimationCurve> animation_curve_;
const base::TickClock* const tick_clock_;
base::TimeTicks start_time_;
ScrollOffset target_offset_; ScrollOffset target_offset_;
ScrollGranularity last_granularity_; ScrollGranularity last_granularity_;
......
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