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

Side by Side Diff: cc/test/CCAnimationTestCommon.cpp

Issue 10961036: Gracefully handle zero duration curves in CCActiveAnimation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | Annotate | Revision Log
« no previous file with comments | « cc/test/CCAnimationTestCommon.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 6
7 #include "CCAnimationTestCommon.h" 7 #include "CCAnimationTestCommon.h"
8 8
9 #include "CCKeyframedAnimationCurve.h" 9 #include "CCKeyframedAnimationCurve.h"
10 #include "CCLayerAnimationController.h" 10 #include "CCLayerAnimationController.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 animation->setNeedsSynchronizedStartTime(true); 51 animation->setNeedsSynchronizedStartTime(true);
52 52
53 target.addAnimation(animation.release()); 53 target.addAnimation(animation.release());
54 } 54 }
55 55
56 } // namespace 56 } // namespace
57 57
58 namespace WebKitTests { 58 namespace WebKitTests {
59 59
60 FakeFloatAnimationCurve::FakeFloatAnimationCurve() 60 FakeFloatAnimationCurve::FakeFloatAnimationCurve()
61 : m_duration(1)
61 { 62 {
62 } 63 }
63 64
65 FakeFloatAnimationCurve::FakeFloatAnimationCurve(double duration)
66 : m_duration(duration)
67 {
68 }
69
64 FakeFloatAnimationCurve::~FakeFloatAnimationCurve() 70 FakeFloatAnimationCurve::~FakeFloatAnimationCurve()
65 { 71 {
66 } 72 }
67 73
68 double FakeFloatAnimationCurve::duration() const 74 double FakeFloatAnimationCurve::duration() const
69 { 75 {
70 return 1; 76 return m_duration;
71 } 77 }
72 78
73 float FakeFloatAnimationCurve::getValue(double now) const 79 float FakeFloatAnimationCurve::getValue(double now) const
74 { 80 {
75 return 0; 81 return 0;
76 } 82 }
77 83
78 PassOwnPtr<cc::CCAnimationCurve> FakeFloatAnimationCurve::clone() const 84 PassOwnPtr<cc::CCAnimationCurve> FakeFloatAnimationCurve::clone() const
79 { 85 {
80 return adoptPtr(new FakeFloatAnimationCurve); 86 return adoptPtr(new FakeFloatAnimationCurve);
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 { 198 {
193 addAnimatedTransform(layer, duration, deltaX, deltaY); 199 addAnimatedTransform(layer, duration, deltaX, deltaY);
194 } 200 }
195 201
196 void addAnimatedTransformToLayer(cc::CCLayerImpl& layer, double duration, int de ltaX, int deltaY) 202 void addAnimatedTransformToLayer(cc::CCLayerImpl& layer, double duration, int de ltaX, int deltaY)
197 { 203 {
198 addAnimatedTransform(*layer.layerAnimationController(), duration, deltaX, de ltaY); 204 addAnimatedTransform(*layer.layerAnimationController(), duration, deltaX, de ltaY);
199 } 205 }
200 206
201 } // namespace WebKitTests 207 } // namespace WebKitTests
OLDNEW
« no previous file with comments | « cc/test/CCAnimationTestCommon.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698