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

Side by Side Diff: cc/base/math_util.h

Issue 1057283003: Remove parts of //cc we aren't using (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 8 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 | « cc/base/invalidation_region.cc ('k') | cc/base/ref_counted_managed.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 #ifndef CC_BASE_MATH_UTIL_H_ 5 #ifndef CC_BASE_MATH_UTIL_H_
6 #define CC_BASE_MATH_UTIL_H_ 6 #define CC_BASE_MATH_UTIL_H_
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <cmath> 9 #include <cmath>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "cc/base/cc_export.h"
15 #include "ui/gfx/geometry/box_f.h" 14 #include "ui/gfx/geometry/box_f.h"
16 #include "ui/gfx/geometry/point3_f.h" 15 #include "ui/gfx/geometry/point3_f.h"
17 #include "ui/gfx/geometry/point_f.h" 16 #include "ui/gfx/geometry/point_f.h"
18 #include "ui/gfx/geometry/scroll_offset.h" 17 #include "ui/gfx/geometry/scroll_offset.h"
19 #include "ui/gfx/geometry/size.h" 18 #include "ui/gfx/geometry/size.h"
20 #include "ui/gfx/transform.h" 19 #include "ui/gfx/transform.h"
21 20
22 namespace base { 21 namespace base {
23 class Value; 22 class Value;
24 namespace trace_event { 23 namespace trace_event {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 } 69 }
71 70
72 SkMScalar x() const { return vec[0]; } 71 SkMScalar x() const { return vec[0]; }
73 SkMScalar y() const { return vec[1]; } 72 SkMScalar y() const { return vec[1]; }
74 SkMScalar z() const { return vec[2]; } 73 SkMScalar z() const { return vec[2]; }
75 SkMScalar w() const { return vec[3]; } 74 SkMScalar w() const { return vec[3]; }
76 75
77 SkMScalar vec[4]; 76 SkMScalar vec[4];
78 }; 77 };
79 78
80 class CC_EXPORT MathUtil { 79 class MathUtil {
81 public: 80 public:
82 static const double kPiDouble; 81 static const double kPiDouble;
83 static const float kPiFloat; 82 static const float kPiFloat;
84 83
85 static double Deg2Rad(double deg) { return deg * kPiDouble / 180.0; } 84 static double Deg2Rad(double deg) { return deg * kPiDouble / 180.0; }
86 static double Rad2Deg(double rad) { return rad * 180.0 / kPiDouble; } 85 static double Rad2Deg(double rad) { return rad * 180.0 / kPiDouble; }
87 86
88 static float Deg2Rad(float deg) { return deg * kPiFloat / 180.0f; } 87 static float Deg2Rad(float deg) { return deg * kPiFloat / 180.0f; }
89 static float Rad2Deg(float rad) { return rad * 180.0f / kPiFloat; } 88 static float Rad2Deg(float rad) { return rad * 180.0f / kPiFloat; }
90 89
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 237
239 // Returns a base::Value representation of the floating point value. 238 // Returns a base::Value representation of the floating point value.
240 // If the value is inf, returns max double/float representation. 239 // If the value is inf, returns max double/float representation.
241 static double AsDoubleSafely(double value); 240 static double AsDoubleSafely(double value);
242 static float AsFloatSafely(float value); 241 static float AsFloatSafely(float value);
243 }; 242 };
244 243
245 } // namespace cc 244 } // namespace cc
246 245
247 #endif // CC_BASE_MATH_UTIL_H_ 246 #endif // CC_BASE_MATH_UTIL_H_
OLDNEW
« no previous file with comments | « cc/base/invalidation_region.cc ('k') | cc/base/ref_counted_managed.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698