Lines Matching +full:max +full:- +full:parallel
4 * Use of this source code is governed by a BSD-style license that can be
17 void SkIntersections::cleanUpParallelLines(bool parallel) { in cleanUpParallelLines() argument
21 if (fUsed == 2 && !parallel) { in cleanUpParallelLines()
48 SkDVector aLen = a[1] - a[0]; in intersectRay()
49 SkDVector bLen = b[1] - b[0]; in intersectRay()
54 byLen * axLen - ayLen * bxLen == 0 ( == denom ) in intersectRay()
56 double denom = bLen.fY * aLen.fX - aLen.fY * bLen.fX; in intersectRay()
59 SkDVector ab0 = a[0] - b[0]; in intersectRay()
60 double numerA = ab0.fY * bLen.fX - bLen.fY * ab0.fX; in intersectRay()
61 double numerB = ab0.fY * aLen.fX - aLen.fY * ab0.fX; in intersectRay()
69 ay - ax * ayLen / axLen == by - bx * ayLen / axLen in intersectRay()
70 axLen * (ay - ax * ayLen / axLen) == axLen * (by - bx * ayLen / axLen) in intersectRay()
71 axLen * ay - ax * ayLen == axLen * by - bx * ayLen in intersectRay()
73 if (!AlmostEqualUlps(aLen.fX * a[0].fY - aLen.fY * a[0].fX, in intersectRay()
74 aLen.fX * b[0].fY - aLen.fY * b[0].fX)) { in intersectRay()
104 double axLen = a[1].fX - a[0].fX; in intersect()
105 double ayLen = a[1].fY - a[0].fY; in intersect()
106 double bxLen = b[1].fX - b[0].fX; in intersect()
107 double byLen = b[1].fY - b[0].fY; in intersect()
112 byLen * axLen - ayLen * bxLen == 0 ( == denom ) in intersect()
116 // detect parallel lines the same way here and in SkOpAngle operator < in intersect()
117 // so that non-parallel means they are also sortable in intersect()
121 double ab0y = a[0].fY - b[0].fY; in intersect()
122 double ab0x = a[0].fX - b[0].fX; in intersect()
123 double numerA = ab0y * bxLen - byLen * ab0x; in intersect()
124 double numerB = ab0y * axLen - ayLen * ab0x; in intersect()
125 double denom = axByLen - ayBxLen; in intersect()
132 /* Allow tracking that both sets of end points are near each other -- the lines are entirely in intersect()
133 coincident -- even when the end points are not exactly the same. in intersect()
164 aNearB[iA] = -1; in intersect()
165 bNearA[nearer] = -1; in intersect()
166 nearCount -= 2; in intersect()
190 double max = line[1].fY; in horizontal_coincident() local
191 if (min > max) { in horizontal_coincident()
193 swap(min, max); in horizontal_coincident()
195 if (min > y || max < y) { in horizontal_coincident()
198 if (AlmostEqualUlps(min, max) && max - min < fabs(line[0].fX - line[1].fX)) { in horizontal_coincident()
206 return SkPinT((y - line[0].fY) / (line[1].fY - line[0].fY)); in HorizontalIntercept()
211 fMax = 3; // clean up parallel at the end will limit the result to 2 at the most in horizontal()
225 insert((double) index, flipped ? 1 - t : t, line[index]); in horizontal()
232 double xIntercept = line[0].fX + fT[0][0] * (line[1].fX - line[0].fX); in horizontal()
234 fT[1][0] = (xIntercept - left) / (right - left); in horizontal()
236 // OPTIMIZATION: ? instead of swapping, pass original line, use [1].fX - [0].fX in horizontal()
238 fT[1][index] = 1 - fT[1][index]; in horizontal()
257 insert((double) index, flipped ? 1 - t : t, line[index]); in horizontal()
268 double max = line[1].fX; in vertical_coincident() local
269 if (min > max) { in vertical_coincident()
271 swap(min, max); in vertical_coincident()
273 if (!precisely_between(min, x, max)) { in vertical_coincident()
276 if (AlmostEqualUlps(min, max)) { in vertical_coincident()
284 return SkPinT((x - line[0].fX) / (line[1].fX - line[0].fX)); in VerticalIntercept()
289 fMax = 3; // cleanup parallel lines will bring this back line in vertical()
303 insert((double) index, flipped ? 1 - t : t, line[index]); in vertical()
310 double yIntercept = line[0].fY + fT[0][0] * (line[1].fY - line[0].fY); in vertical()
312 fT[1][0] = (yIntercept - top) / (bottom - top); in vertical()
314 // OPTIMIZATION: instead of swapping, pass original line, use [1].fY - [0].fY in vertical()
316 fT[1][index] = 1 - fT[1][index]; in vertical()
335 insert((double) index, flipped ? 1 - t : t, line[index]); in vertical()