Lines Matching refs:clip
90 bool SkLineClipper::IntersectLine(const SkPoint src[2], const SkRect& clip,
95 if (containsNoEmptyCheck(clip, bounds)) {
103 if (nestedLT(bounds.fRight, clip.fLeft, bounds.width()) ||
104 nestedLT(clip.fRight, bounds.fLeft, bounds.width()) ||
105 nestedLT(bounds.fBottom, clip.fTop, bounds.height()) ||
106 nestedLT(clip.fBottom, bounds.fTop, bounds.height())) {
124 if (tmp[index0].fY < clip.fTop) {
125 tmp[index0].set(sect_with_horizontal(src, clip.fTop), clip.fTop);
127 if (tmp[index1].fY > clip.fBottom) {
128 tmp[index1].set(sect_with_horizontal(src, clip.fBottom), clip.fBottom);
140 if ((tmp[index1].fX <= clip.fLeft || tmp[index0].fX >= clip.fRight)) {
142 // with the clip.
143 if (tmp[0].fX != tmp[1].fX || tmp[0].fX < clip.fLeft || tmp[0].fX > clip.fRight) {
148 if (tmp[index0].fX < clip.fLeft) {
149 tmp[index0].set(clip.fLeft, sect_with_vertical(src, clip.fLeft));
151 if (tmp[index1].fX > clip.fRight) {
152 tmp[index1].set(clip.fRight, sect_with_vertical(src, clip.fRight));
156 SkASSERT(containsNoEmptyCheck(clip, bounds));
175 int SkLineClipper::ClipLine(const SkPoint pts[], const SkRect& clip, SkPoint lines[],
189 if (pts[index1].fY <= clip.fTop) { // we're above the clip
192 if (pts[index0].fY >= clip.fBottom) { // we're below the clip
202 if (pts[index0].fY < clip.fTop) {
203 tmp[index0].set(sect_with_horizontal(pts, clip.fTop), clip.fTop);
206 if (tmp[index1].fY > clip.fBottom) {
207 tmp[index1].set(sect_with_horizontal(pts, clip.fBottom), clip.fBottom);
211 // Chop it into 1..3 segments that are wholly within the clip in X.
229 if (tmp[index1].fX <= clip.fLeft) { // wholly to the left
230 tmp[0].fX = tmp[1].fX = clip.fLeft;
233 } else if (tmp[index0].fX >= clip.fRight) { // wholly to the right
237 tmp[0].fX = tmp[1].fX = clip.fRight;
244 if (tmp[index0].fX < clip.fLeft) {
245 r->set(clip.fLeft, tmp[index0].fY);
247 r->set(clip.fLeft, sect_clamp_with_vertical(tmp, clip.fLeft));
254 if (tmp[index1].fX > clip.fRight) {
255 r->set(clip.fRight, sect_clamp_with_vertical(tmp, clip.fRight));
258 r->set(clip.fRight, tmp[index1].fY);