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

Side by Side Diff: third_party/WebKit/Source/platform/animation/CompositorScrollOffsetAnimationCurve.cpp

Issue 2015113003: Correctly update scroll offset animations in response to scroll anchoring (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 4 years, 6 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "platform/animation/CompositorScrollOffsetAnimationCurve.h" 5 #include "platform/animation/CompositorScrollOffsetAnimationCurve.h"
6 #include "platform/animation/TimingFunction.h" 6 #include "platform/animation/TimingFunction.h"
7 7
8 #include "cc/animation/scroll_offset_animation_curve.h" 8 #include "cc/animation/scroll_offset_animation_curve.h"
9 #include "cc/animation/timing_function.h" 9 #include "cc/animation/timing_function.h"
10 10
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 { 53 {
54 m_curve->SetInitialValue(gfx::ScrollOffset(initialValue.x(), initialValue.y( ))); 54 m_curve->SetInitialValue(gfx::ScrollOffset(initialValue.x(), initialValue.y( )));
55 } 55 }
56 56
57 FloatPoint CompositorScrollOffsetAnimationCurve::getValue(double time) const 57 FloatPoint CompositorScrollOffsetAnimationCurve::getValue(double time) const
58 { 58 {
59 gfx::ScrollOffset value = m_curve->GetValue(base::TimeDelta::FromSecondsD(ti me)); 59 gfx::ScrollOffset value = m_curve->GetValue(base::TimeDelta::FromSecondsD(ti me));
60 return FloatPoint(value.x(), value.y()); 60 return FloatPoint(value.x(), value.y());
61 } 61 }
62 62
63 void CompositorScrollOffsetAnimationCurve::applyAdjustment(IntSize adjustment)
64 {
65 m_curve->ApplyAdjustment(gfx::Vector2dF(adjustment.width(), adjustment.heigh t()));
66 }
67
63 double CompositorScrollOffsetAnimationCurve::duration() const 68 double CompositorScrollOffsetAnimationCurve::duration() const
64 { 69 {
65 return m_curve->Duration().InSecondsF(); 70 return m_curve->Duration().InSecondsF();
66 } 71 }
67 72
68 FloatPoint CompositorScrollOffsetAnimationCurve::targetValue() const 73 FloatPoint CompositorScrollOffsetAnimationCurve::targetValue() const
69 { 74 {
70 gfx::ScrollOffset target = m_curve->target_value(); 75 gfx::ScrollOffset target = m_curve->target_value();
71 return FloatPoint(target.x(), target.y()); 76 return FloatPoint(target.x(), target.y());
72 } 77 }
73 78
74 void CompositorScrollOffsetAnimationCurve::updateTarget(double time, FloatPoint newTarget) 79 void CompositorScrollOffsetAnimationCurve::updateTarget(double time, FloatPoint newTarget)
75 { 80 {
76 m_curve->UpdateTarget(time, gfx::ScrollOffset(newTarget.x(), newTarget.y())) ; 81 m_curve->UpdateTarget(time, gfx::ScrollOffset(newTarget.x(), newTarget.y())) ;
77 } 82 }
78 83
79 std::unique_ptr<cc::AnimationCurve> CompositorScrollOffsetAnimationCurve::cloneT oAnimationCurve() const 84 std::unique_ptr<cc::AnimationCurve> CompositorScrollOffsetAnimationCurve::cloneT oAnimationCurve() const
80 { 85 {
81 return m_curve->Clone(); 86 return m_curve->Clone();
82 } 87 }
83 88
84 } // namespace blink 89 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698