Lines Matching refs:line

58 void SkIntersections::computePoints(const SkDLine& line, int used) {
59 fPt[0] = line.ptAtT(fT[0][0]);
61 fPt[1] = line.ptAtT(fT[0][1]);
114 // see if end points intersect the opposite line
126 /* Determine the intersection point of two line segments
214 static int horizontal_coincident(const SkDLine& line, double y) {
215 double min = line[0].fY;
216 double max = line[1].fY;
223 if (AlmostEqualUlps(min, max) && max - min < fabs(line[0].fX - line[1].fX)) {
229 static double horizontal_intercept(const SkDLine& line, double y) {
230 return SkPinT((y - line[0].fY) / (line[1].fY - line[0].fY));
233 int SkIntersections::horizontal(const SkDLine& line, double y) {
235 int horizontalType = horizontal_coincident(line, y);
237 fT[0][0] = horizontal_intercept(line, y);
245 int SkIntersections::horizontal(const SkDLine& line, double left, double right,
248 // see if end points intersect the opposite line
251 if ((t = line.exactPoint(leftPt)) >= 0) {
256 if ((t = line.exactPoint(rightPt)) >= 0) {
260 if ((t = SkDLine::ExactPointH(line[index], left, right, y)) >= 0) {
261 insert((double) index, flipped ? 1 - t : t, line[index]);
265 int result = horizontal_coincident(line, y);
267 fT[0][0] = horizontal_intercept(line, y);
268 double xIntercept = line[0].fX + fT[0][0] * (line[1].fX - line[0].fX);
272 // OPTIMIZATION: ? instead of swapping, pass original line, use [1].fX - [0].fX
283 if ((t = line.nearPoint(leftPt, NULL)) >= 0) {
288 if ((t = line.nearPoint(rightPt, NULL)) >= 0) {
292 if ((t = SkDLine::NearPointH(line[index], left, right, y)) >= 0) {
293 insert((double) index, flipped ? 1 - t : t, line[index]);
302 static int vertical_coincident(const SkDLine& line, double x) {
303 double min = line[0].fX;
304 double max = line[1].fX;
317 static double vertical_intercept(const SkDLine& line, double x) {
318 return SkPinT((x - line[0].fX) / (line[1].fX - line[0].fX));
321 int SkIntersections::vertical(const SkDLine& line, double x) {
323 int verticalType = vertical_coincident(line, x);
325 fT[0][0] = vertical_intercept(line, x);
333 int SkIntersections::vertical(const SkDLine& line, double top, double bottom,
335 fMax = 3; // cleanup parallel lines will bring this back line
336 // see if end points intersect the opposite line
339 if ((t = line.exactPoint(topPt)) >= 0) {
344 if ((t = line.exactPoint(bottomPt)) >= 0) {
348 if ((t = SkDLine::ExactPointV(line[index], top, bottom, x)) >= 0) {
349 insert((double) index, flipped ? 1 - t : t, line[index]);
353 int result = vertical_coincident(line, x);
355 fT[0][0] = vertical_intercept(line, x);
356 double yIntercept = line[0].fY + fT[0][0] * (line[1].fY - line[0].fY);
360 // OPTIMIZATION: instead of swapping, pass original line, use [1].fY - [0].fY
371 if ((t = line.nearPoint(topPt, NULL)) >= 0) {
376 if ((t = line.nearPoint(bottomPt, NULL)) >= 0) {
380 if ((t = SkDLine::NearPointV(line[index], top, bottom, x)) >= 0) {
381 insert((double) index, flipped ? 1 - t : t, line[index]);