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

Side by Side Diff: Source/platform/scroll/ProgrammaticScrollAnimator.cpp

Issue 470443002: Revert of Rename WebAnimation to WebCompositorAnimation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « Source/platform/graphics/GraphicsLayerTest.cpp ('k') | Source/web/LinkHighlight.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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "platform/scroll/ProgrammaticScrollAnimator.h" 6 #include "platform/scroll/ProgrammaticScrollAnimator.h"
7 7
8 #include "platform/geometry/IntPoint.h" 8 #include "platform/geometry/IntPoint.h"
9 #include "platform/scroll/ScrollableArea.h" 9 #include "platform/scroll/ScrollableArea.h"
10 #include "public/platform/Platform.h" 10 #include "public/platform/Platform.h"
(...skipping 20 matching lines...) Expand all
31 void ProgrammaticScrollAnimator::resetAnimationState() 31 void ProgrammaticScrollAnimator::resetAnimationState()
32 { 32 {
33 m_animationCurve.clear(); 33 m_animationCurve.clear();
34 m_startTime = 0.0; 34 m_startTime = 0.0;
35 } 35 }
36 36
37 void ProgrammaticScrollAnimator::animateToOffset(FloatPoint offset) 37 void ProgrammaticScrollAnimator::animateToOffset(FloatPoint offset)
38 { 38 {
39 m_startTime = 0.0; 39 m_startTime = 0.0;
40 m_targetOffset = offset; 40 m_targetOffset = offset;
41 m_animationCurve = adoptPtr(Platform::current()->compositorSupport()->create ScrollOffsetAnimationCurve(m_targetOffset, WebCompositorAnimationCurve::TimingFu nctionTypeEaseInOut)); 41 m_animationCurve = adoptPtr(Platform::current()->compositorSupport()->create ScrollOffsetAnimationCurve(m_targetOffset, WebAnimationCurve::TimingFunctionType EaseInOut));
42 42
43 m_animationCurve->setInitialValue(FloatPoint(m_scrollableArea->scrollPositio n())); 43 m_animationCurve->setInitialValue(FloatPoint(m_scrollableArea->scrollPositio n()));
44 if (!m_scrollableArea->scheduleAnimation()) { 44 if (!m_scrollableArea->scheduleAnimation()) {
45 resetAnimationState(); 45 resetAnimationState();
46 m_scrollableArea->notifyScrollPositionChanged(IntPoint(offset.x(), offse t.y())); 46 m_scrollableArea->notifyScrollPositionChanged(IntPoint(offset.x(), offse t.y()));
47 } 47 }
48 } 48 }
49 49
50 void ProgrammaticScrollAnimator::cancelAnimation() 50 void ProgrammaticScrollAnimator::cancelAnimation()
51 { 51 {
(...skipping 13 matching lines...) Expand all
65 if (isFinished) { 65 if (isFinished) {
66 resetAnimationState(); 66 resetAnimationState();
67 } else if (!m_scrollableArea->scheduleAnimation()) { 67 } else if (!m_scrollableArea->scheduleAnimation()) {
68 m_scrollableArea->notifyScrollPositionChanged(IntPoint(m_targetOffse t.x(), m_targetOffset.y())); 68 m_scrollableArea->notifyScrollPositionChanged(IntPoint(m_targetOffse t.x(), m_targetOffset.y()));
69 resetAnimationState(); 69 resetAnimationState();
70 } 70 }
71 } 71 }
72 } 72 }
73 73
74 } // namespace blink 74 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/graphics/GraphicsLayerTest.cpp ('k') | Source/web/LinkHighlight.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698