Lines Matching refs:p0
69 static int clip_line(const SkRect& bounds, SkPoint p0, SkPoint p1, SkPoint edges[]) {
72 if (p0.fY == p1.fY) {
76 if (p0.fY > p1.fY) {
78 swap(p0, p1);
81 if (p1.fY <= bounds.top() || p0.fY >= bounds.bottom()) {
85 double dxdy = (double)(p1.fX - p0.fX) / (p1.fY - p0.fY);
86 if (p0.fY < bounds.top()) {
87 p0.fX = SkDoubleToScalar(p0.fX + dxdy * (bounds.top() - p0.fY));
88 p0.fY = bounds.top();
97 if (p0.fX > p1.fX) {
99 swap(p0, p1);
104 p0.fX = p1.fX = bounds.left();
105 *edges++ = p0;
109 if (p0.fX >= bounds.right()) { // entirely to the right
110 p0.fX = p1.fX = bounds.right();
111 *edges++ = p0;
116 if (p0.fX < bounds.left()) {
117 float y = SkDoubleToScalar(p0.fY + (bounds.left() - p0.fX) / dxdy);
118 *edges++ = SkPoint::Make(bounds.left(), p0.fY);
120 p0.set(bounds.left(), y);
123 float y = SkDoubleToScalar(p0.fY + (bounds.right() - p0.fX) / dxdy);
124 *edges++ = p0;
128 *edges++ = p0;
135 SkPoint p0, SkPoint p1, const SkPaint& paint) { in draw_clipped_line() argument
137 int count = clip_line(bounds, p0, p1, verts); in draw_clipped_line()