Lines Matching defs:line
34 void SkIntersections::computePoints(const SkDLine& line, int used) {
35 fPt[0] = line.ptAtT(fT[0][0]);
37 fPt[1] = line.ptAtT(fT[0][1]);
84 // see if end points intersect the opposite line
96 /* Determine the intersection point of two line segments
183 static int horizontal_coincident(const SkDLine& line, double y) {
184 double min = line[0].fY;
185 double max = line[1].fY;
193 if (AlmostEqualUlps(min, max) && max - min < fabs(line[0].fX - line[1].fX)) {
199 double SkIntersections::HorizontalIntercept(const SkDLine& line, double y) {
200 SkASSERT(line[1].fY != line[0].fY);
201 return SkPinT((y - line[0].fY) / (line[1].fY - line[0].fY));
204 int SkIntersections::horizontal(const SkDLine& line, double left, double right,
207 // see if end points intersect the opposite line
210 if ((t = line.exactPoint(leftPt)) >= 0) {
215 if ((t = line.exactPoint(rightPt)) >= 0) {
219 if ((t = SkDLine::ExactPointH(line[index], left, right, y)) >= 0) {
220 insert((double) index, flipped ? 1 - t : t, line[index]);
224 int result = horizontal_coincident(line, y);
226 fT[0][0] = HorizontalIntercept(line, y);
227 double xIntercept = line[0].fX + fT[0][0] * (line[1].fX - line[0].fX);
231 // OPTIMIZATION: ? instead of swapping, pass original line, use [1].fX - [0].fX
242 if ((t = line.nearPoint(leftPt, nullptr)) >= 0) {
247 if ((t = line.nearPoint(rightPt, nullptr)) >= 0) {
251 if ((t = SkDLine::NearPointH(line[index], left, right, y)) >= 0) {
252 insert((double) index, flipped ? 1 - t : t, line[index]);
261 static int vertical_coincident(const SkDLine& line, double x) {
262 double min = line[0].fX;
263 double max = line[1].fX;
277 double SkIntersections::VerticalIntercept(const SkDLine& line, double x) {
278 SkASSERT(line[1].fX != line[0].fX);
279 return SkPinT((x - line[0].fX) / (line[1].fX - line[0].fX));
282 int SkIntersections::vertical(const SkDLine& line, double top, double bottom,
284 fMax = 3; // cleanup parallel lines will bring this back line
285 // see if end points intersect the opposite line
288 if ((t = line.exactPoint(topPt)) >= 0) {
293 if ((t = line.exactPoint(bottomPt)) >= 0) {
297 if ((t = SkDLine::ExactPointV(line[index], top, bottom, x)) >= 0) {
298 insert((double) index, flipped ? 1 - t : t, line[index]);
302 int result = vertical_coincident(line, x);
304 fT[0][0] = VerticalIntercept(line, x);
305 double yIntercept = line[0].fY + fT[0][0] * (line[1].fY - line[0].fY);
309 // OPTIMIZATION: instead of swapping, pass original line, use [1].fY - [0].fY
320 if ((t = line.nearPoint(topPt, nullptr)) >= 0) {
325 if ((t = line.nearPoint(bottomPt, nullptr)) >= 0) {
329 if ((t = SkDLine::NearPointV(line[index], top, bottom, x)) >= 0) {
330 insert((double) index, flipped ? 1 - t : t, line[index]);