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 <memory> | 10 #include <memory> |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 const HomogeneousCoordinate& h1, | 198 const HomogeneousCoordinate& h1, |
199 const HomogeneousCoordinate& h2, | 199 const HomogeneousCoordinate& h2, |
200 const HomogeneousCoordinate& h3, | 200 const HomogeneousCoordinate& h3, |
201 const HomogeneousCoordinate& h4); | 201 const HomogeneousCoordinate& h4); |
202 | 202 |
203 // NOTE: These functions do not do correct clipping against w = 0 plane, but | 203 // NOTE: These functions do not do correct clipping against w = 0 plane, but |
204 // they correctly detect the clipped condition via the boolean clipped. | 204 // they correctly detect the clipped condition via the boolean clipped. |
205 static gfx::QuadF MapQuad(const gfx::Transform& transform, | 205 static gfx::QuadF MapQuad(const gfx::Transform& transform, |
206 const gfx::QuadF& quad, | 206 const gfx::QuadF& quad, |
207 bool* clipped); | 207 bool* clipped); |
208 static gfx::QuadF MapQuad3d(const gfx::Transform& transform, | |
209 const gfx::QuadF& q, | |
210 gfx::Point3F* p, | |
211 bool* clipped); | |
212 static gfx::PointF MapPoint(const gfx::Transform& transform, | 208 static gfx::PointF MapPoint(const gfx::Transform& transform, |
213 const gfx::PointF& point, | 209 const gfx::PointF& point, |
214 bool* clipped); | 210 bool* clipped); |
215 static gfx::Point3F MapPoint(const gfx::Transform&, | |
216 const gfx::Point3F&, | |
217 bool* clipped); | |
218 static gfx::QuadF ProjectQuad(const gfx::Transform& transform, | |
219 const gfx::QuadF& quad, | |
220 bool* clipped); | |
221 static gfx::PointF ProjectPoint(const gfx::Transform& transform, | 211 static gfx::PointF ProjectPoint(const gfx::Transform& transform, |
222 const gfx::PointF& point, | 212 const gfx::PointF& point, |
223 bool* clipped); | 213 bool* clipped); |
224 // Identical to the above function, but coerces the homogeneous coordinate to | 214 // Identical to the above function, but coerces the homogeneous coordinate to |
225 // a 3d rather than a 2d point. | 215 // a 3d rather than a 2d point. |
226 static gfx::Point3F ProjectPoint3D(const gfx::Transform& transform, | 216 static gfx::Point3F ProjectPoint3D(const gfx::Transform& transform, |
227 const gfx::PointF& point, | 217 const gfx::PointF& point, |
228 bool* clipped); | 218 bool* clipped); |
229 | 219 |
230 static gfx::Vector2dF ComputeTransform2dScaleComponents(const gfx::Transform&, | 220 static gfx::Vector2dF ComputeTransform2dScaleComponents(const gfx::Transform&, |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 private: | 323 private: |
334 #ifdef __SSE__ | 324 #ifdef __SSE__ |
335 unsigned int orig_state_; | 325 unsigned int orig_state_; |
336 #endif | 326 #endif |
337 DISALLOW_COPY_AND_ASSIGN(ScopedSubnormalFloatDisabler); | 327 DISALLOW_COPY_AND_ASSIGN(ScopedSubnormalFloatDisabler); |
338 }; | 328 }; |
339 | 329 |
340 } // namespace cc | 330 } // namespace cc |
341 | 331 |
342 #endif // CC_BASE_MATH_UTIL_H_ | 332 #endif // CC_BASE_MATH_UTIL_H_ |
OLD | NEW |