Chromium Code Reviews| 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 183 | 183 |
| 184 if (registerAndScheduleAnimation()) | 184 if (registerAndScheduleAnimation()) |
| 185 m_runState = RunState::WaitingToSendToCompositor; | 185 m_runState = RunState::WaitingToSendToCompositor; |
| 186 | 186 |
| 187 return true; | 187 return true; |
| 188 } | 188 } |
| 189 | 189 |
| 190 void ScrollAnimator::adjustAnimationAndSetScrollPosition( | 190 void ScrollAnimator::adjustAnimationAndSetScrollPosition( |
| 191 const DoublePoint& position, | 191 const DoublePoint& position, |
| 192 ScrollType scrollType) { | 192 ScrollType scrollType) { |
| 193 DoublePoint adjustedPos = m_scrollableArea->clampScrollPosition(position); | |
| 194 IntSize actualAdjustment = | 193 IntSize actualAdjustment = |
|
skobes
2016/10/04 22:25:26
Rename this to "adjustment" (the "actual" part mak
szager1
2016/10/04 22:54:14
Done.
| |
| 195 roundedIntPoint(adjustedPos) - | 194 roundedIntPoint(position) - |
| 196 roundedIntPoint(m_scrollableArea->scrollPositionDouble()); | 195 roundedIntPoint(m_scrollableArea->scrollPositionDouble()); |
| 197 | 196 |
| 198 scrollPositionChanged(adjustedPos, scrollType); | 197 scrollPositionChanged(position, scrollType); |
| 199 | 198 |
| 200 if (m_runState == RunState::Idle) { | 199 if (m_runState == RunState::Idle) { |
| 201 adjustImplOnlyScrollOffsetAnimation(actualAdjustment); | 200 adjustImplOnlyScrollOffsetAnimation(actualAdjustment); |
| 202 } else if (hasRunningAnimation()) { | 201 } else if (hasRunningAnimation()) { |
| 203 m_targetOffset += toFloatSize(actualAdjustment); | 202 m_targetOffset += toFloatSize(actualAdjustment); |
| 204 if (m_animationCurve) { | 203 if (m_animationCurve) { |
| 205 m_animationCurve->applyAdjustment(actualAdjustment); | 204 m_animationCurve->applyAdjustment(actualAdjustment); |
| 206 if (m_runState != RunState::RunningOnMainThread && | 205 if (m_runState != RunState::RunningOnMainThread && |
| 207 registerAndScheduleAnimation()) | 206 registerAndScheduleAnimation()) |
| 208 m_runState = RunState::RunningOnCompositorButNeedsAdjustment; | 207 m_runState = RunState::RunningOnCompositorButNeedsAdjustment; |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 433 return false; | 432 return false; |
| 434 } | 433 } |
| 435 return true; | 434 return true; |
| 436 } | 435 } |
| 437 | 436 |
| 438 DEFINE_TRACE(ScrollAnimator) { | 437 DEFINE_TRACE(ScrollAnimator) { |
| 439 ScrollAnimatorBase::trace(visitor); | 438 ScrollAnimatorBase::trace(visitor); |
| 440 } | 439 } |
| 441 | 440 |
| 442 } // namespace blink | 441 } // namespace blink |
| OLD | NEW |