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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 const gfx::Transform& transform, | 182 const gfx::Transform& transform, |
183 const gfx::Rect& rect); | 183 const gfx::Rect& rect); |
184 | 184 |
185 // Returns an array of vertices that represent the clipped polygon. After | 185 // Returns an array of vertices that represent the clipped polygon. After |
186 // returning, indexes from 0 to num_vertices_in_clipped_quad are valid in the | 186 // returning, indexes from 0 to num_vertices_in_clipped_quad are valid in the |
187 // clipped_quad array. Note that num_vertices_in_clipped_quad may be zero, | 187 // clipped_quad array. Note that num_vertices_in_clipped_quad may be zero, |
188 // which means the entire quad was clipped, and none of the vertices in the | 188 // which means the entire quad was clipped, and none of the vertices in the |
189 // array are valid. | 189 // array are valid. |
190 static bool MapClippedQuad3d(const gfx::Transform& transform, | 190 static bool MapClippedQuad3d(const gfx::Transform& transform, |
191 const gfx::QuadF& src_quad, | 191 const gfx::QuadF& src_quad, |
192 gfx::Point3F clipped_quad[8], | 192 gfx::Point3F clipped_quad[6], |
193 int* num_vertices_in_clipped_quad); | 193 int* num_vertices_in_clipped_quad); |
194 | 194 |
195 static gfx::RectF ComputeEnclosingRectOfVertices(const gfx::PointF vertices[], | 195 static gfx::RectF ComputeEnclosingRectOfVertices(const gfx::PointF vertices[], |
196 int num_vertices); | 196 int num_vertices); |
197 static gfx::RectF ComputeEnclosingClippedRect( | 197 static gfx::RectF ComputeEnclosingClippedRect( |
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 |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 private: | 333 private: |
334 #ifdef __SSE__ | 334 #ifdef __SSE__ |
335 unsigned int orig_state_; | 335 unsigned int orig_state_; |
336 #endif | 336 #endif |
337 DISALLOW_COPY_AND_ASSIGN(ScopedSubnormalFloatDisabler); | 337 DISALLOW_COPY_AND_ASSIGN(ScopedSubnormalFloatDisabler); |
338 }; | 338 }; |
339 | 339 |
340 } // namespace cc | 340 } // namespace cc |
341 | 341 |
342 #endif // CC_BASE_MATH_UTIL_H_ | 342 #endif // CC_BASE_MATH_UTIL_H_ |
OLD | NEW |