| OLD | NEW |
| 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 <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 static float SmallestAngleBetweenVectors(gfx::Vector2dF v1, | 138 static float SmallestAngleBetweenVectors(gfx::Vector2dF v1, |
| 139 gfx::Vector2dF v2); | 139 gfx::Vector2dF v2); |
| 140 | 140 |
| 141 // Projects the |source| vector onto |destination|. Neither vector is assumed | 141 // Projects the |source| vector onto |destination|. Neither vector is assumed |
| 142 // to be normalized. | 142 // to be normalized. |
| 143 static gfx::Vector2dF ProjectVector(gfx::Vector2dF source, | 143 static gfx::Vector2dF ProjectVector(gfx::Vector2dF source, |
| 144 gfx::Vector2dF destination); | 144 gfx::Vector2dF destination); |
| 145 | 145 |
| 146 // Conversion to value. | 146 // Conversion to value. |
| 147 static scoped_ptr<base::Value> AsValue(gfx::Size s); | 147 static scoped_ptr<base::Value> AsValue(gfx::Size s); |
| 148 static scoped_ptr<base::Value> AsValue(gfx::Rect r); |
| 148 static scoped_ptr<base::Value> AsValue(gfx::PointF q); | 149 static scoped_ptr<base::Value> AsValue(gfx::PointF q); |
| 149 static scoped_ptr<base::Value> AsValue(const gfx::QuadF& q); | 150 static scoped_ptr<base::Value> AsValue(const gfx::QuadF& q); |
| 150 static scoped_ptr<base::Value> AsValue(const gfx::RectF& rect); | 151 static scoped_ptr<base::Value> AsValue(const gfx::RectF& rect); |
| 151 | 152 |
| 152 // Returns a base::Value representation of the floating point value. | 153 // Returns a base::Value representation of the floating point value. |
| 153 // If the value is inf, returns max double/float representation. | 154 // If the value is inf, returns max double/float representation. |
| 154 static scoped_ptr<base::Value> AsValueSafely(double value); | 155 static scoped_ptr<base::Value> AsValueSafely(double value); |
| 155 static scoped_ptr<base::Value> AsValueSafely(float value); | 156 static scoped_ptr<base::Value> AsValueSafely(float value); |
| 156 }; | 157 }; |
| 157 | 158 |
| 158 } // namespace cc | 159 } // namespace cc |
| 159 | 160 |
| 160 #endif // CC_BASE_MATH_UTIL_H_ | 161 #endif // CC_BASE_MATH_UTIL_H_ |
| OLD | NEW |