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

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

Issue 2007103003: Expand WTF::StringView's API to be more like StringPiece. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove bad assert. 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 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 "platform/animation/TimingFunction.h" 5 #include "platform/animation/TimingFunction.h"
6 6
7 #include "platform/animation/CubicBezierControlPoints.h" 7 #include "platform/animation/CubicBezierControlPoints.h"
8 #include "wtf/MathExtras.h" 8 #include "wtf/MathExtras.h"
9 9
10 namespace blink { 10 namespace blink {
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 case StepPosition::END: 120 case StepPosition::END:
121 positionString = "end"; 121 positionString = "end";
122 break; 122 break;
123 } 123 }
124 124
125 StringBuilder builder; 125 StringBuilder builder;
126 if (this->numberOfSteps() == 1) { 126 if (this->numberOfSteps() == 1) {
127 builder.append("step-"); 127 builder.append("step-");
128 builder.append(positionString); 128 builder.append(positionString);
129 } else { 129 } else {
130 builder.append("steps(" + String::numberToStringECMAScript(this->numberO fSteps()) + ", "); 130 builder.append("steps(");
131 builder.append(String::numberToStringECMAScript(this->numberOfSteps()));
132 builder.append(", ");
131 builder.append(positionString); 133 builder.append(positionString);
132 builder.append(')'); 134 builder.append(')');
133 } 135 }
134 return builder.toString(); 136 return builder.toString();
135 } 137 }
136 138
137 void StepsTimingFunction::range(double* minValue, double* maxValue) const 139 void StepsTimingFunction::range(double* minValue, double* maxValue) const
138 { 140 {
139 *minValue = 0; 141 *minValue = 0;
140 *maxValue = 1; 142 *maxValue = 1;
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 return false; 209 return false;
208 } 210 }
209 211
210 // No need to define specific operator!= as they can all come via this function. 212 // No need to define specific operator!= as they can all come via this function.
211 bool operator!=(const TimingFunction& lhs, const TimingFunction& rhs) 213 bool operator!=(const TimingFunction& lhs, const TimingFunction& rhs)
212 { 214 {
213 return !(lhs == rhs); 215 return !(lhs == rhs);
214 } 216 }
215 217
216 } // namespace blink 218 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/testing/UnionTypesTest.cpp ('k') | third_party/WebKit/Source/platform/exported/WebString.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698