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 <algorithm> | 8 #include <algorithm> |
9 #include <cmath> | 9 #include <cmath> |
10 | 10 |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 // to be normalized. | 171 // to be normalized. |
172 static gfx::Vector2dF ProjectVector(const gfx::Vector2dF& source, | 172 static gfx::Vector2dF ProjectVector(const gfx::Vector2dF& source, |
173 const gfx::Vector2dF& destination); | 173 const gfx::Vector2dF& destination); |
174 | 174 |
175 // Conversion to value. | 175 // Conversion to value. |
176 static scoped_ptr<base::Value> AsValue(const gfx::Size& s); | 176 static scoped_ptr<base::Value> AsValue(const gfx::Size& s); |
177 static scoped_ptr<base::Value> AsValue(const gfx::SizeF& s); | 177 static scoped_ptr<base::Value> AsValue(const gfx::SizeF& s); |
178 static scoped_ptr<base::Value> AsValue(const gfx::Rect& r); | 178 static scoped_ptr<base::Value> AsValue(const gfx::Rect& r); |
179 static bool FromValue(const base::Value*, gfx::Rect* out_rect); | 179 static bool FromValue(const base::Value*, gfx::Rect* out_rect); |
180 static scoped_ptr<base::Value> AsValue(const gfx::PointF& q); | 180 static scoped_ptr<base::Value> AsValue(const gfx::PointF& q); |
| 181 static scoped_ptr<base::Value> AsValue(const gfx::Point3F&); |
181 static scoped_ptr<base::Value> AsValue(const gfx::Vector2d& v); | 182 static scoped_ptr<base::Value> AsValue(const gfx::Vector2d& v); |
182 static scoped_ptr<base::Value> AsValue(const gfx::QuadF& q); | 183 static scoped_ptr<base::Value> AsValue(const gfx::QuadF& q); |
183 static scoped_ptr<base::Value> AsValue(const gfx::RectF& rect); | 184 static scoped_ptr<base::Value> AsValue(const gfx::RectF& rect); |
184 static scoped_ptr<base::Value> AsValue(const gfx::Transform& transform); | 185 static scoped_ptr<base::Value> AsValue(const gfx::Transform& transform); |
185 static scoped_ptr<base::Value> AsValue(const gfx::BoxF& box); | 186 static scoped_ptr<base::Value> AsValue(const gfx::BoxF& box); |
186 | 187 |
187 // Returns a base::Value representation of the floating point value. | 188 // Returns a base::Value representation of the floating point value. |
188 // If the value is inf, returns max double/float representation. | 189 // If the value is inf, returns max double/float representation. |
189 static scoped_ptr<base::Value> AsValueSafely(double value); | 190 static scoped_ptr<base::Value> AsValueSafely(double value); |
190 static scoped_ptr<base::Value> AsValueSafely(float value); | 191 static scoped_ptr<base::Value> AsValueSafely(float value); |
191 }; | 192 }; |
192 | 193 |
193 } // namespace cc | 194 } // namespace cc |
194 | 195 |
195 #endif // CC_BASE_MATH_UTIL_H_ | 196 #endif // CC_BASE_MATH_UTIL_H_ |
OLD | NEW |