| 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 // animation rather than animating multiple scrollers at the same time. | 140 // animation rather than animating multiple scrollers at the same time. |
| 141 return ScrollResult(false, false, delta.Width(), delta.Height()); | 141 return ScrollResult(false, false, delta.Width(), delta.Height()); |
| 142 } | 142 } |
| 143 | 143 |
| 144 bool ScrollAnimator::WillAnimateToOffset(const ScrollOffset& target_offset) { | 144 bool ScrollAnimator::WillAnimateToOffset(const ScrollOffset& target_offset) { |
| 145 if (run_state_ == RunState::kPostAnimationCleanup) | 145 if (run_state_ == RunState::kPostAnimationCleanup) |
| 146 ResetAnimationState(); | 146 ResetAnimationState(); |
| 147 | 147 |
| 148 if (run_state_ == RunState::kWaitingToCancelOnCompositor || | 148 if (run_state_ == RunState::kWaitingToCancelOnCompositor || |
| 149 run_state_ == RunState::kWaitingToCancelOnCompositorButNewScroll) { | 149 run_state_ == RunState::kWaitingToCancelOnCompositorButNewScroll) { |
| 150 ASSERT(animation_curve_); | 150 DCHECK(animation_curve_); |
| 151 target_offset_ = target_offset; | 151 target_offset_ = target_offset; |
| 152 if (RegisterAndScheduleAnimation()) | 152 if (RegisterAndScheduleAnimation()) |
| 153 run_state_ = RunState::kWaitingToCancelOnCompositorButNewScroll; | 153 run_state_ = RunState::kWaitingToCancelOnCompositorButNewScroll; |
| 154 return true; | 154 return true; |
| 155 } | 155 } |
| 156 | 156 |
| 157 if (animation_curve_) { | 157 if (animation_curve_) { |
| 158 if ((target_offset - target_offset_).IsZero()) | 158 if ((target_offset - target_offset_).IsZero()) |
| 159 return true; | 159 return true; |
| 160 | 160 |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |