| 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 #include <vector> | 10 #include <vector> |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 } | 26 } |
| 27 } // namespace base | 27 } // namespace base |
| 28 | 28 |
| 29 namespace gfx { | 29 namespace gfx { |
| 30 class QuadF; | 30 class QuadF; |
| 31 class Rect; | 31 class Rect; |
| 32 class RectF; | 32 class RectF; |
| 33 class Transform; | 33 class Transform; |
| 34 class Vector2dF; | 34 class Vector2dF; |
| 35 class Vector2d; | 35 class Vector2d; |
| 36 class Vector3dF; |
| 36 } | 37 } |
| 37 | 38 |
| 38 namespace cc { | 39 namespace cc { |
| 39 | 40 |
| 40 struct HomogeneousCoordinate { | 41 struct HomogeneousCoordinate { |
| 41 HomogeneousCoordinate(SkMScalar x, SkMScalar y, SkMScalar z, SkMScalar w) { | 42 HomogeneousCoordinate(SkMScalar x, SkMScalar y, SkMScalar z, SkMScalar w) { |
| 42 vec[0] = x; | 43 vec[0] = x; |
| 43 vec[1] = y; | 44 vec[1] = y; |
| 44 vec[2] = z; | 45 vec[2] = z; |
| 45 vec[3] = w; | 46 vec[3] = w; |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 const gfx::Transform& transform, | 234 const gfx::Transform& transform, |
| 234 base::trace_event::TracedValue* res); | 235 base::trace_event::TracedValue* res); |
| 235 static void AddToTracedValue(const char* name, | 236 static void AddToTracedValue(const char* name, |
| 236 const gfx::BoxF& box, | 237 const gfx::BoxF& box, |
| 237 base::trace_event::TracedValue* res); | 238 base::trace_event::TracedValue* res); |
| 238 | 239 |
| 239 // Returns a base::Value representation of the floating point value. | 240 // Returns a base::Value representation of the floating point value. |
| 240 // If the value is inf, returns max double/float representation. | 241 // If the value is inf, returns max double/float representation. |
| 241 static double AsDoubleSafely(double value); | 242 static double AsDoubleSafely(double value); |
| 242 static float AsFloatSafely(float value); | 243 static float AsFloatSafely(float value); |
| 244 |
| 245 // Returns vector that x axis (1,0,0) transforms to under given transform. |
| 246 static gfx::Vector3dF GetXAxis(const gfx::Transform& transform); |
| 247 |
| 248 // Returns vector that y axis (0,1,0) transforms to under given transform. |
| 249 static gfx::Vector3dF GetYAxis(const gfx::Transform& transform); |
| 243 }; | 250 }; |
| 244 | 251 |
| 245 } // namespace cc | 252 } // namespace cc |
| 246 | 253 |
| 247 #endif // CC_BASE_MATH_UTIL_H_ | 254 #endif // CC_BASE_MATH_UTIL_H_ |
| OLD | NEW |