Chromium Code Reviews| Index: cc/base/math_util.cc |
| diff --git a/cc/base/math_util.cc b/cc/base/math_util.cc |
| index d28c195971f6cd14eb753b6d9eddd51d1dd082fb..c29f75d7101348fff392cd55c9e658afee5c9523 100644 |
| --- a/cc/base/math_util.cc |
| +++ b/cc/base/math_util.cc |
| @@ -158,6 +158,12 @@ static inline void ExpandBoundsToIncludePoint(float* xmin, |
| static inline void AddVertexToClippedQuad(const gfx::PointF& new_vertex, |
| gfx::PointF clipped_quad[8], |
| int* num_vertices_in_clipped_quad) { |
| + if (*num_vertices_in_clipped_quad > 0) { |
| + if (clipped_quad[*num_vertices_in_clipped_quad - 1] == new_vertex) |
|
Peter Mayo
2016/12/08 19:37:39
These are floating point values, and should use an
flackr
2016/12/08 20:24:01
If the problem case is clipping to the same infini
Peter Mayo
2016/12/08 20:29:09
Inifinity is a single value in the non-parametric
|
| + return; |
| + if (clipped_quad[0] == new_vertex) |
| + return; |
| + } |
| clipped_quad[*num_vertices_in_clipped_quad] = new_vertex; |
| (*num_vertices_in_clipped_quad)++; |
| } |
| @@ -165,6 +171,12 @@ static inline void AddVertexToClippedQuad(const gfx::PointF& new_vertex, |
| static inline void AddVertexToClippedQuad3d(const gfx::Point3F& new_vertex, |
| gfx::Point3F clipped_quad[8], |
| int* num_vertices_in_clipped_quad) { |
| + if (*num_vertices_in_clipped_quad > 0) { |
| + if (clipped_quad[*num_vertices_in_clipped_quad - 1] == new_vertex) |
| + return; |
| + if (clipped_quad[0] == new_vertex) |
| + return; |
| + } |
| clipped_quad[*num_vertices_in_clipped_quad] = new_vertex; |
| (*num_vertices_in_clipped_quad)++; |
| } |