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

Side by Side Diff: app/tween.cc

Issue 3034039: FBTF: Minor gfx/ header cleanup. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: win fix Created 10 years, 4 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 | « app/tween.h ('k') | app/x11_util.h » ('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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "app/tween.h" 5 #include "app/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 "base/logging.h"
13 #include "gfx/rect.h" 14 #include "gfx/rect.h"
14 15
15 // static 16 // static
16 double Tween::CalculateValue(Tween::Type type, double state) { 17 double Tween::CalculateValue(Tween::Type type, double state) {
17 DCHECK_GE(state, 0); 18 DCHECK_GE(state, 0);
18 DCHECK_LE(state, 1); 19 DCHECK_LE(state, 1);
19 20
20 switch (type) { 21 switch (type) {
21 case EASE_IN: 22 case EASE_IN:
22 return pow(state, 2); 23 return pow(state, 2);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 gfx::Rect Tween::ValueBetween(double value, 73 gfx::Rect Tween::ValueBetween(double value,
73 const gfx::Rect& start_bounds, 74 const gfx::Rect& start_bounds,
74 const gfx::Rect& target_bounds) { 75 const gfx::Rect& target_bounds) {
75 return gfx::Rect(ValueBetween(value, start_bounds.x(), target_bounds.x()), 76 return gfx::Rect(ValueBetween(value, start_bounds.x(), target_bounds.x()),
76 ValueBetween(value, start_bounds.y(), target_bounds.y()), 77 ValueBetween(value, start_bounds.y(), target_bounds.y()),
77 ValueBetween(value, start_bounds.width(), 78 ValueBetween(value, start_bounds.width(),
78 target_bounds.width()), 79 target_bounds.width()),
79 ValueBetween(value, start_bounds.height(), 80 ValueBetween(value, start_bounds.height(),
80 target_bounds.height())); 81 target_bounds.height()));
81 } 82 }
OLDNEW
« no previous file with comments | « app/tween.h ('k') | app/x11_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698