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

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

Issue 2885983004: Remove DEFINE_STATIC_REF calls from header files (Closed)
Patch Set: Created 3 years, 7 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 | « third_party/WebKit/Source/platform/animation/TimingFunction.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 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/wtf/text/StringBuilder.h" 7 #include "platform/wtf/text/StringBuilder.h"
8 8
9 namespace blink { 9 namespace blink {
10 10
11 String LinearTimingFunction::ToString() const { 11 String LinearTimingFunction::ToString() const {
12 return "linear"; 12 return "linear";
13 } 13 }
14 14
15 double LinearTimingFunction::Evaluate(double fraction, double) const { 15 double LinearTimingFunction::Evaluate(double fraction, double) const {
16 return fraction; 16 return fraction;
17 } 17 }
18 18
19 void LinearTimingFunction::Range(double* min_value, double* max_value) const {} 19 void LinearTimingFunction::Range(double* min_value, double* max_value) const {}
20 20
21 std::unique_ptr<cc::TimingFunction> LinearTimingFunction::CloneToCC() const { 21 std::unique_ptr<cc::TimingFunction> LinearTimingFunction::CloneToCC() const {
22 return nullptr; 22 return nullptr;
23 } 23 }
24 24
25 CubicBezierTimingFunction* CubicBezierTimingFunction::Preset(
26 EaseType ease_type) {
27 DEFINE_STATIC_REF(CubicBezierTimingFunction, ease,
28 (AdoptRef(new CubicBezierTimingFunction(EaseType::EASE))));
29 DEFINE_STATIC_REF(
30 CubicBezierTimingFunction, ease_in,
31 (AdoptRef(new CubicBezierTimingFunction(EaseType::EASE_IN))));
32 DEFINE_STATIC_REF(
33 CubicBezierTimingFunction, ease_out,
34 (AdoptRef(new CubicBezierTimingFunction(EaseType::EASE_OUT))));
35 DEFINE_STATIC_REF(
36 CubicBezierTimingFunction, ease_in_out,
37 (AdoptRef(new CubicBezierTimingFunction(EaseType::EASE_IN_OUT))));
38
39 switch (ease_type) {
40 case EaseType::EASE:
41 return ease;
42 case EaseType::EASE_IN:
43 return ease_in;
44 case EaseType::EASE_OUT:
45 return ease_out;
46 case EaseType::EASE_IN_OUT:
47 return ease_in_out;
48 default:
49 NOTREACHED();
50 return nullptr;
51 }
52 }
53
25 String CubicBezierTimingFunction::ToString() const { 54 String CubicBezierTimingFunction::ToString() const {
26 switch (this->GetEaseType()) { 55 switch (this->GetEaseType()) {
27 case CubicBezierTimingFunction::EaseType::EASE: 56 case CubicBezierTimingFunction::EaseType::EASE:
28 return "ease"; 57 return "ease";
29 case CubicBezierTimingFunction::EaseType::EASE_IN: 58 case CubicBezierTimingFunction::EaseType::EASE_IN:
30 return "ease-in"; 59 return "ease-in";
31 case CubicBezierTimingFunction::EaseType::EASE_OUT: 60 case CubicBezierTimingFunction::EaseType::EASE_OUT:
32 return "ease-out"; 61 return "ease-out";
33 case CubicBezierTimingFunction::EaseType::EASE_IN_OUT: 62 case CubicBezierTimingFunction::EaseType::EASE_IN_OUT:
34 return "ease-in-out"; 63 return "ease-in-out";
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 } 252 }
224 return false; 253 return false;
225 } 254 }
226 255
227 // No need to define specific operator!= as they can all come via this function. 256 // No need to define specific operator!= as they can all come via this function.
228 bool operator!=(const TimingFunction& lhs, const TimingFunction& rhs) { 257 bool operator!=(const TimingFunction& lhs, const TimingFunction& rhs) {
229 return !(lhs == rhs); 258 return !(lhs == rhs);
230 } 259 }
231 260
232 } // namespace blink 261 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/animation/TimingFunction.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698