| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2011, Google Inc. All rights reserved. | 2 * Copyright (c) 2011, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 // over an animation, do nothing to avoid judder. | 402 // over an animation, do nothing to avoid judder. |
| 403 if (HasRunningAnimation()) | 403 if (HasRunningAnimation()) |
| 404 return; | 404 return; |
| 405 | 405 |
| 406 cc::ScrollOffsetAnimationCurve* scroll_offset_animation_curve = | 406 cc::ScrollOffsetAnimationCurve* scroll_offset_animation_curve = |
| 407 curve->ToScrollOffsetAnimationCurve(); | 407 curve->ToScrollOffsetAnimationCurve(); |
| 408 ScrollOffset target_value(scroll_offset_animation_curve->target_value().x(), | 408 ScrollOffset target_value(scroll_offset_animation_curve->target_value().x(), |
| 409 scroll_offset_animation_curve->target_value().y()); | 409 scroll_offset_animation_curve->target_value().y()); |
| 410 if (WillAnimateToOffset(target_value)) { | 410 if (WillAnimateToOffset(target_value)) { |
| 411 animation_curve_ = CompositorScrollOffsetAnimationCurve::Create( | 411 animation_curve_ = CompositorScrollOffsetAnimationCurve::Create( |
| 412 std::move(scroll_offset_animation_curve)); | 412 scroll_offset_animation_curve); |
| 413 start_time_ = animation_start_time; | 413 start_time_ = animation_start_time; |
| 414 } | 414 } |
| 415 } | 415 } |
| 416 | 416 |
| 417 void ScrollAnimator::CancelAnimation() { | 417 void ScrollAnimator::CancelAnimation() { |
| 418 ScrollAnimatorCompositorCoordinator::CancelAnimation(); | 418 ScrollAnimatorCompositorCoordinator::CancelAnimation(); |
| 419 } | 419 } |
| 420 | 420 |
| 421 void ScrollAnimator::TakeOverCompositorAnimation() { | 421 void ScrollAnimator::TakeOverCompositorAnimation() { |
| 422 if (run_state_ == RunState::kRunningOnCompositor || | 422 if (run_state_ == RunState::kRunningOnCompositor || |
| (...skipping 17 matching lines...) Expand all Loading... |
| 440 return false; | 440 return false; |
| 441 } | 441 } |
| 442 return true; | 442 return true; |
| 443 } | 443 } |
| 444 | 444 |
| 445 DEFINE_TRACE(ScrollAnimator) { | 445 DEFINE_TRACE(ScrollAnimator) { |
| 446 ScrollAnimatorBase::Trace(visitor); | 446 ScrollAnimatorBase::Trace(visitor); |
| 447 } | 447 } |
| 448 | 448 |
| 449 } // namespace blink | 449 } // namespace blink |
| OLD | NEW |