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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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::Point3F&); |
182 static scoped_ptr<base::Value> AsValue(const gfx::Vector2d& v); | 182 static scoped_ptr<base::Value> AsValue(const gfx::Vector2d& v); |
| 183 static scoped_ptr<base::Value> AsValue(const gfx::Vector2dF& v); |
183 static scoped_ptr<base::Value> AsValue(const gfx::QuadF& q); | 184 static scoped_ptr<base::Value> AsValue(const gfx::QuadF& q); |
184 static scoped_ptr<base::Value> AsValue(const gfx::RectF& rect); | 185 static scoped_ptr<base::Value> AsValue(const gfx::RectF& rect); |
185 static scoped_ptr<base::Value> AsValue(const gfx::Transform& transform); | 186 static scoped_ptr<base::Value> AsValue(const gfx::Transform& transform); |
186 static scoped_ptr<base::Value> AsValue(const gfx::BoxF& box); | 187 static scoped_ptr<base::Value> AsValue(const gfx::BoxF& box); |
187 | 188 |
188 // Returns a base::Value representation of the floating point value. | 189 // Returns a base::Value representation of the floating point value. |
189 // If the value is inf, returns max double/float representation. | 190 // If the value is inf, returns max double/float representation. |
190 static scoped_ptr<base::Value> AsValueSafely(double value); | 191 static scoped_ptr<base::Value> AsValueSafely(double value); |
191 static scoped_ptr<base::Value> AsValueSafely(float value); | 192 static scoped_ptr<base::Value> AsValueSafely(float value); |
192 }; | 193 }; |
193 | 194 |
194 } // namespace cc | 195 } // namespace cc |
195 | 196 |
196 #endif // CC_BASE_MATH_UTIL_H_ | 197 #endif // CC_BASE_MATH_UTIL_H_ |
OLD | NEW |