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_MATH_UTIL_H_ | 5 #ifndef CC_MATH_UTIL_H_ |
6 #define CC_MATH_UTIL_H_ | 6 #define CC_MATH_UTIL_H_ |
7 | 7 |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/scoped_ptr.h" |
9 #include "cc/cc_export.h" | 10 #include "cc/cc_export.h" |
10 #include "ui/gfx/point_f.h" | 11 #include "ui/gfx/point_f.h" |
11 #include "ui/gfx/point3_f.h" | 12 #include "ui/gfx/point3_f.h" |
| 13 #include "ui/gfx/size.h" |
12 #include "ui/gfx/transform.h" | 14 #include "ui/gfx/transform.h" |
13 | 15 |
| 16 namespace base { |
| 17 class Value; |
| 18 } |
| 19 |
14 namespace gfx { | 20 namespace gfx { |
15 class QuadF; | 21 class QuadF; |
16 class Rect; | 22 class Rect; |
17 class RectF; | 23 class RectF; |
18 class Transform; | 24 class Transform; |
19 class Vector2dF; | 25 class Vector2dF; |
20 } | 26 } |
21 | 27 |
22 namespace cc { | 28 namespace cc { |
23 | 29 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 static gfx::PointF projectPoint(const gfx::Transform&, const gfx::PointF&, b
ool& clipped); | 111 static gfx::PointF projectPoint(const gfx::Transform&, const gfx::PointF&, b
ool& clipped); |
106 | 112 |
107 static gfx::Vector2dF computeTransform2dScaleComponents(const gfx::Transform
&, float fallbackValue); | 113 static gfx::Vector2dF computeTransform2dScaleComponents(const gfx::Transform
&, float fallbackValue); |
108 | 114 |
109 // Returns the smallest angle between the given two vectors in degrees. Neit
her vector is | 115 // Returns the smallest angle between the given two vectors in degrees. Neit
her vector is |
110 // assumed to be normalized. | 116 // assumed to be normalized. |
111 static float smallestAngleBetweenVectors(gfx::Vector2dF, gfx::Vector2dF); | 117 static float smallestAngleBetweenVectors(gfx::Vector2dF, gfx::Vector2dF); |
112 | 118 |
113 // Projects the |source| vector onto |destination|. Neither vector is assume
d to be normalized. | 119 // Projects the |source| vector onto |destination|. Neither vector is assume
d to be normalized. |
114 static gfx::Vector2dF projectVector(gfx::Vector2dF source, gfx::Vector2dF de
stination); | 120 static gfx::Vector2dF projectVector(gfx::Vector2dF source, gfx::Vector2dF de
stination); |
| 121 |
| 122 // Conversion to value. |
| 123 static scoped_ptr<base::Value> asValue(gfx::Size s); |
| 124 static scoped_ptr<base::Value> asValue(gfx::PointF q); |
| 125 static scoped_ptr<base::Value> asValue(gfx::QuadF q); |
115 }; | 126 }; |
116 | 127 |
117 } // namespace cc | 128 } // namespace cc |
118 | 129 |
119 #endif // CC_MATH_UTIL_H_ | 130 #endif // CC_MATH_UTIL_H_ |
OLD | NEW |