OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. | 2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above | 8 * 1. Redistributions of source code must retain the above |
9 * copyright notice, this list of conditions and the following | 9 * copyright notice, this list of conditions and the following |
10 * disclaimer. | 10 * disclaimer. |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 while (vertexIndex2) { | 72 while (vertexIndex2) { |
73 unsigned vertexIndex3 = nextVertexIndex(vertexIndex2, nVertices, clockwi
se); | 73 unsigned vertexIndex3 = nextVertexIndex(vertexIndex2, nVertices, clockwi
se); |
74 if (!areCollinearPoints(polygon.vertexAt(vertexIndex1), polygon.vertexAt
(vertexIndex2), polygon.vertexAt(vertexIndex3))) | 74 if (!areCollinearPoints(polygon.vertexAt(vertexIndex1), polygon.vertexAt
(vertexIndex2), polygon.vertexAt(vertexIndex3))) |
75 break; | 75 break; |
76 vertexIndex2 = vertexIndex3; | 76 vertexIndex2 = vertexIndex3; |
77 } | 77 } |
78 | 78 |
79 return vertexIndex2; | 79 return vertexIndex2; |
80 } | 80 } |
81 | 81 |
82 FloatPolygon::FloatPolygon(PassOwnPtr<Vector<FloatPoint> > vertices, WindRule fi
llRule) | 82 FloatPolygon::FloatPolygon(PassOwnPtr<Vector<FloatPoint>> vertices, WindRule fil
lRule) |
83 : m_vertices(vertices) | 83 : m_vertices(vertices) |
84 , m_fillRule(fillRule) | 84 , m_fillRule(fillRule) |
85 { | 85 { |
86 unsigned nVertices = numberOfVertices(); | 86 unsigned nVertices = numberOfVertices(); |
87 m_edges.resize(nVertices); | 87 m_edges.resize(nVertices); |
88 m_empty = nVertices < 3; | 88 m_empty = nVertices < 3; |
89 | 89 |
90 if (nVertices) | 90 if (nVertices) |
91 m_boundingBox.setLocation(vertexAt(0)); | 91 m_boundingBox.setLocation(vertexAt(0)); |
92 | 92 |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 float uOtherLine = determinant(thisDelta, vertex1Delta) / denominator; | 218 float uOtherLine = determinant(thisDelta, vertex1Delta) / denominator; |
219 | 219 |
220 if (uThisLine < 0 || uOtherLine < 0 || uThisLine > 1 || uOtherLine > 1) | 220 if (uThisLine < 0 || uOtherLine < 0 || uThisLine > 1 || uOtherLine > 1) |
221 return false; | 221 return false; |
222 | 222 |
223 point = vertex1() + uThisLine * thisDelta; | 223 point = vertex1() + uThisLine * thisDelta; |
224 return true; | 224 return true; |
225 } | 225 } |
226 | 226 |
227 } // namespace blink | 227 } // namespace blink |
OLD | NEW |