Lines Matching refs:p0
71 static int clip_line(const SkRect& bounds, SkPoint p0, SkPoint p1, SkPoint edges[]) {
74 if (p0.fY == p1.fY) {
78 if (p0.fY > p1.fY) {
80 swap(p0, p1);
83 if (p1.fY <= bounds.top() || p0.fY >= bounds.bottom()) {
87 double dxdy = (double)(p1.fX - p0.fX) / (p1.fY - p0.fY);
88 if (p0.fY < bounds.top()) {
89 p0.fX = SkDoubleToScalar(p0.fX + dxdy * (bounds.top() - p0.fY));
90 p0.fY = bounds.top();
99 if (p0.fX > p1.fX) {
101 swap(p0, p1);
106 p0.fX = p1.fX = bounds.left();
107 *edges++ = p0;
111 if (p0.fX >= bounds.right()) { // entirely to the right
112 p0.fX = p1.fX = bounds.right();
113 *edges++ = p0;
118 if (p0.fX < bounds.left()) {
119 float y = SkDoubleToScalar(p0.fY + (bounds.left() - p0.fX) / dxdy);
120 *edges++ = SkPoint::Make(bounds.left(), p0.fY);
122 p0.set(bounds.left(), y);
125 float y = SkDoubleToScalar(p0.fY + (bounds.right() - p0.fX) / dxdy);
126 *edges++ = p0;
130 *edges++ = p0;
137 SkPoint p0, SkPoint p1, const SkPaint& paint) { in draw_clipped_line() argument
139 int count = clip_line(bounds, p0, p1, verts); in draw_clipped_line()