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

Side by Side Diff: ui/gfx/animation/tween.cc

Issue 140253013: Define accelerated steps time function. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated patch: remove question about velocity Created 6 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
« no previous file with comments | « ui/gfx/animation/steps_unittest.cc ('k') | ui/gfx/geometry/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "ui/gfx/animation/tween.h" 5 #include "ui/gfx/animation/tween.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #if defined(OS_WIN) 9 #if defined(OS_WIN)
10 #include <float.h> 10 #include <float.h>
11 #endif 11 #endif
12 12
13 #include <algorithm> 13 #include <algorithm>
14 14
15 #include "base/basictypes.h" 15 #include "base/basictypes.h"
16 #include "base/logging.h" 16 #include "base/logging.h"
17 #include "ui/gfx/geometry/cubic_bezier.h" 17 #include "ui/gfx/animation/cubic_bezier.h"
18 #include "ui/gfx/safe_integer_conversions.h" 18 #include "ui/gfx/safe_integer_conversions.h"
19 19
20 namespace gfx { 20 namespace gfx {
21 21
22 // static 22 // static
23 double Tween::CalculateValue(Tween::Type type, double state) { 23 double Tween::CalculateValue(Tween::Type type, double state) {
24 DCHECK_GE(state, 0); 24 DCHECK_GE(state, 0);
25 DCHECK_LE(state, 1); 25 DCHECK_LE(state, 1);
26 26
27 switch (type) { 27 switch (type) {
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 if (value <= 0.0) 174 if (value <= 0.0)
175 return start_transform; 175 return start_transform;
176 176
177 gfx::Transform to_return = end_transform; 177 gfx::Transform to_return = end_transform;
178 to_return.Blend(start_transform, value); 178 to_return.Blend(start_transform, value);
179 179
180 return to_return; 180 return to_return;
181 } 181 }
182 182
183 } // namespace gfx 183 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/animation/steps_unittest.cc ('k') | ui/gfx/geometry/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698