Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(316)

Side by Side Diff: third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp

Issue 2336823003: Fix ScrollAnimator::hasRunningAnimation to account for the PostAnimationCleanup (Closed)
Patch Set: comment update Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 FloatPoint ScrollAnimator::desiredTargetPosition() const 75 FloatPoint ScrollAnimator::desiredTargetPosition() const
76 { 76 {
77 if (m_runState == RunState::WaitingToCancelOnCompositor) 77 if (m_runState == RunState::WaitingToCancelOnCompositor)
78 return currentPosition(); 78 return currentPosition();
79 return (m_animationCurve || m_runState == RunState::WaitingToSendToComposito r) 79 return (m_animationCurve || m_runState == RunState::WaitingToSendToComposito r)
80 ? m_targetOffset : currentPosition(); 80 ? m_targetOffset : currentPosition();
81 } 81 }
82 82
83 bool ScrollAnimator::hasRunningAnimation() const 83 bool ScrollAnimator::hasRunningAnimation() const
84 { 84 {
85 return (m_animationCurve || m_runState == RunState::WaitingToSendToComposito r); 85 return m_runState != RunState::PostAnimationCleanup
86 && (m_animationCurve || m_runState == RunState::WaitingToSendToComposito r);
86 } 87 }
87 88
88 FloatSize ScrollAnimator::computeDeltaToConsume(const FloatSize& delta) const 89 FloatSize ScrollAnimator::computeDeltaToConsume(const FloatSize& delta) const
89 { 90 {
90 FloatPoint pos = desiredTargetPosition(); 91 FloatPoint pos = desiredTargetPosition();
91 FloatPoint newPos = toFloatPoint(m_scrollableArea->clampScrollPosition(pos + delta)); 92 FloatPoint newPos = toFloatPoint(m_scrollableArea->clampScrollPosition(pos + delta));
92 return newPos - pos; 93 return newPos - pos;
93 } 94 }
94 95
95 void ScrollAnimator::resetAnimationState() 96 void ScrollAnimator::resetAnimationState()
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 } 459 }
459 return true; 460 return true;
460 } 461 }
461 462
462 DEFINE_TRACE(ScrollAnimator) 463 DEFINE_TRACE(ScrollAnimator)
463 { 464 {
464 ScrollAnimatorBase::trace(visitor); 465 ScrollAnimatorBase::trace(visitor);
465 } 466 }
466 467
467 } // namespace blink 468 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698