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

Side by Side Diff: Source/platform/animation/TimingFunction.h

Issue 1213003004: Fix virtual/override/final usage in Source/platform/. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 5 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) 3 * (C) 2000 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 }; 94 };
95 95
96 class PLATFORM_EXPORT LinearTimingFunction final : public TimingFunction { 96 class PLATFORM_EXPORT LinearTimingFunction final : public TimingFunction {
97 public: 97 public:
98 static LinearTimingFunction* shared() 98 static LinearTimingFunction* shared()
99 { 99 {
100 DEFINE_STATIC_REF(LinearTimingFunction, linear, (adoptRef(new LinearTimi ngFunction()))); 100 DEFINE_STATIC_REF(LinearTimingFunction, linear, (adoptRef(new LinearTimi ngFunction())));
101 return linear; 101 return linear;
102 } 102 }
103 103
104 virtual ~LinearTimingFunction() { } 104 ~LinearTimingFunction() override { }
105 105
106 virtual String toString() const override; 106 String toString() const override;
107 107
108 virtual double evaluate(double fraction, double) const override; 108 double evaluate(double fraction, double) const override;
109 virtual void range(double* minValue, double* maxValue) const override; 109 void range(double* minValue, double* maxValue) const override;
110 virtual void partition(Vector<PartitionRegion>& regions) const override; 110 void partition(Vector<PartitionRegion>& regions) const override;
111 private: 111 private:
112 LinearTimingFunction() 112 LinearTimingFunction()
113 : TimingFunction(LinearFunction) 113 : TimingFunction(LinearFunction)
114 { 114 {
115 } 115 }
116 }; 116 };
117 117
118 class PLATFORM_EXPORT CubicBezierTimingFunction final : public TimingFunction { 118 class PLATFORM_EXPORT CubicBezierTimingFunction final : public TimingFunction {
119 public: 119 public:
120 enum SubType { 120 enum SubType {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 { 152 {
153 DEFINE_STATIC_REF(CubicBezierTimingFunction, easeInOut, (adoptRe f(new CubicBezierTimingFunction(EaseInOut, 0.42, 0.0, 0.58, 1.0)))); 153 DEFINE_STATIC_REF(CubicBezierTimingFunction, easeInOut, (adoptRe f(new CubicBezierTimingFunction(EaseInOut, 0.42, 0.0, 0.58, 1.0))));
154 return easeInOut; 154 return easeInOut;
155 } 155 }
156 default: 156 default:
157 ASSERT_NOT_REACHED(); 157 ASSERT_NOT_REACHED();
158 return 0; 158 return 0;
159 } 159 }
160 } 160 }
161 161
162 virtual ~CubicBezierTimingFunction() { } 162 ~CubicBezierTimingFunction() override { }
163 163
164 virtual String toString() const override; 164 String toString() const override;
165 165
166 virtual double evaluate(double fraction, double accuracy) const override; 166 double evaluate(double fraction, double accuracy) const override;
167 virtual void range(double* minValue, double* maxValue) const override; 167 void range(double* minValue, double* maxValue) const override;
168 virtual void partition(Vector<PartitionRegion>& regions) const override; 168 void partition(Vector<PartitionRegion>& regions) const override;
169 169
170 double x1() const { return m_x1; } 170 double x1() const { return m_x1; }
171 double y1() const { return m_y1; } 171 double y1() const { return m_y1; }
172 double x2() const { return m_x2; } 172 double x2() const { return m_x2; }
173 double y2() const { return m_y2; } 173 double y2() const { return m_y2; }
174 174
175 SubType subType() const { return m_subType; } 175 SubType subType() const { return m_subType; }
176 176
177 private: 177 private:
178 explicit CubicBezierTimingFunction(SubType subType, double x1, double y1, do uble x2, double y2) 178 explicit CubicBezierTimingFunction(SubType subType, double x1, double y1, do uble x2, double y2)
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 return middle; 223 return middle;
224 case End: 224 case End:
225 return end; 225 return end;
226 default: 226 default:
227 ASSERT_NOT_REACHED(); 227 ASSERT_NOT_REACHED();
228 return end; 228 return end;
229 } 229 }
230 } 230 }
231 231
232 232
233 virtual ~StepsTimingFunction() { } 233 ~StepsTimingFunction() override { }
234 234
235 virtual String toString() const override; 235 String toString() const override;
236 236
237 virtual double evaluate(double fraction, double) const override; 237 double evaluate(double fraction, double) const override;
238 virtual void range(double* minValue, double* maxValue) const override; 238 void range(double* minValue, double* maxValue) const override;
239 virtual void partition(Vector<PartitionRegion>& regions) const override; 239 void partition(Vector<PartitionRegion>& regions) const override;
240 240
241 int numberOfSteps() const { return m_steps; } 241 int numberOfSteps() const { return m_steps; }
242 StepAtPosition stepAtPosition() const { return m_stepAtPosition; } 242 StepAtPosition stepAtPosition() const { return m_stepAtPosition; }
243 243
244 private: 244 private:
245 StepsTimingFunction(int steps, StepAtPosition stepAtPosition) 245 StepsTimingFunction(int steps, StepAtPosition stepAtPosition)
246 : TimingFunction(StepsFunction) 246 : TimingFunction(StepsFunction)
247 , m_steps(steps) 247 , m_steps(steps)
248 , m_stepAtPosition(stepAtPosition) 248 , m_stepAtPosition(stepAtPosition)
249 { 249 {
(...skipping 16 matching lines...) Expand all
266 value->type() == TimingFunction::typeName##Function, \ 266 value->type() == TimingFunction::typeName##Function, \
267 value.type() == TimingFunction::typeName##Function) 267 value.type() == TimingFunction::typeName##Function)
268 268
269 DEFINE_TIMING_FUNCTION_TYPE_CASTS(Linear); 269 DEFINE_TIMING_FUNCTION_TYPE_CASTS(Linear);
270 DEFINE_TIMING_FUNCTION_TYPE_CASTS(CubicBezier); 270 DEFINE_TIMING_FUNCTION_TYPE_CASTS(CubicBezier);
271 DEFINE_TIMING_FUNCTION_TYPE_CASTS(Steps); 271 DEFINE_TIMING_FUNCTION_TYPE_CASTS(Steps);
272 272
273 } // namespace blink 273 } // namespace blink
274 274
275 #endif // TimingFunction_h 275 #endif // TimingFunction_h
OLDNEW
« no previous file with comments | « Source/platform/UserGestureIndicator.cpp ('k') | Source/platform/audio/AudioDSPKernelProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698