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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
105 | 105 |
106 TRACE_EVENT0("blink", "ScrollAnimator::scroll"); | 106 TRACE_EVENT0("blink", "ScrollAnimator::scroll"); |
107 | 107 |
108 if (granularity == ScrollByPrecisePixel) { | 108 if (granularity == ScrollByPrecisePixel) { |
109 // Cancel scroll animation because asked to instant scroll. | 109 // Cancel scroll animation because asked to instant scroll. |
110 if (hasRunningAnimation()) | 110 if (hasRunningAnimation()) |
111 cancelAnimation(); | 111 cancelAnimation(); |
112 return ScrollAnimatorBase::userScroll(granularity, delta); | 112 return ScrollAnimatorBase::userScroll(granularity, delta); |
113 } | 113 } |
114 | 114 |
115 if (m_runState == RunState::PostAnimationCleanup) | |
116 resetAnimationState(); | |
ajuma
2016/03/29 18:41:57
What happens to the actual cleanup (specifically,
ymalik
2016/03/29 19:42:17
That's a good point (though that's a separate issu
| |
117 | |
115 FloatSize consumedDelta = computeDeltaToConsume(delta); | 118 FloatSize consumedDelta = computeDeltaToConsume(delta); |
116 | 119 |
117 FloatPoint targetPos = desiredTargetPosition(); | 120 FloatPoint targetPos = desiredTargetPosition(); |
118 targetPos.move(consumedDelta); | 121 targetPos.move(consumedDelta); |
119 | 122 |
120 if (willAnimateToOffset(targetPos)) { | 123 if (willAnimateToOffset(targetPos)) { |
121 m_lastGranularity = granularity; | 124 m_lastGranularity = granularity; |
122 // Report unused delta only if there is no animation running. See | 125 // Report unused delta only if there is no animation running. See |
123 // comment below regarding scroll latching. | 126 // comment below regarding scroll latching. |
124 // TODO(bokan): Need to standardize how ScrollAnimators report | 127 // TODO(bokan): Need to standardize how ScrollAnimators report |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
402 } | 405 } |
403 return true; | 406 return true; |
404 } | 407 } |
405 | 408 |
406 DEFINE_TRACE(ScrollAnimator) | 409 DEFINE_TRACE(ScrollAnimator) |
407 { | 410 { |
408 ScrollAnimatorBase::trace(visitor); | 411 ScrollAnimatorBase::trace(visitor); |
409 } | 412 } |
410 | 413 |
411 } // namespace blink | 414 } // namespace blink |
OLD | NEW |