int verticalIntersect(double axisIntercept, double top, double bottom, bool flipped) { addExactVerticalEndPoints(top, bottom, axisIntercept); if (fAllowNear) { addNearVerticalEndPoints(top, bottom, axisIntercept); } double rootVals[2]; int roots = verticalIntersect(axisIntercept, rootVals); for (int index = 0; index < roots; ++index) { double quadT = rootVals[index]; SkDPoint pt = fQuad.ptAtT(quadT); double lineT = (pt.fY - top) / (bottom - top); if (pinTs(&quadT, &lineT, &pt, kPointInitialized)) { fIntersections->insert(quadT, lineT, pt); } } if (flipped) { fIntersections->flip(); } return fIntersections->used(); }
int verticalIntersect(double axisIntercept, double top, double bottom, bool flipped) { addExactVerticalEndPoints(top, bottom, axisIntercept); if (fAllowNear) { addNearVerticalEndPoints(top, bottom, axisIntercept); } double roots[3]; int count = VerticalIntersect(fCubic, axisIntercept, roots); for (int index = 0; index < count; ++index) { double cubicT = roots[index]; SkDPoint pt = { axisIntercept, fCubic.ptAtT(cubicT).fY }; double lineT = (pt.fY - top) / (bottom - top); if (pinTs(&cubicT, &lineT, &pt, kPointInitialized) && uniqueAnswer(cubicT, pt)) { fIntersections->insert(cubicT, lineT, pt); } } if (flipped) { fIntersections->flip(); } checkCoincident(); return fIntersections->used(); }