Lines Matching refs:pts

51     const SkPoint pts[] = { p0, p1 };
52 int lineCount = SkLineClipper::ClipLine(pts, clip, lines, fCanCullToTheRight);
84 static bool chopMonoQuadAtY(SkPoint pts[3], SkScalar y, SkScalar* t) {
85 return chopMonoQuadAt(pts[0].fY, pts[1].fY, pts[2].fY, y, t);
88 static bool chopMonoQuadAtX(SkPoint pts[3], SkScalar x, SkScalar* t) {
89 return chopMonoQuadAt(pts[0].fX, pts[1].fX, pts[2].fX, x, t);
92 // Modify pts[] in place so that it is clipped in Y to the clip rect
93 static void chop_quad_in_Y(SkPoint pts[3], const SkRect& clip) {
98 if (pts[0].fY < clip.fTop) {
99 if (chopMonoQuadAtY(pts, clip.fTop, &t)) {
101 SkChopQuadAt(pts, tmp, t);
106 pts[0] = tmp[2];
107 pts[1] = tmp[3];
112 if (pts[i].fY < clip.fTop) {
113 pts[i].fY = clip.fTop;
120 if (pts[2].fY > clip.fBottom) {
121 if (chopMonoQuadAtY(pts, clip.fBottom, &t)) {
122 SkChopQuadAt(pts, tmp, t);
127 pts[1] = tmp[1];
128 pts[2] = tmp[2];
133 if (pts[i].fY > clip.fBottom) {
134 pts[i].fY = clip.fBottom;
143 SkPoint pts[3];
144 bool reverse = sort_increasing_Y(pts, srcPts, 3);
147 if (pts[2].fY <= clip.fTop || pts[0].fY >= clip.fBottom) {
151 // Now chop so that pts is contained within clip in Y
152 chop_quad_in_Y(pts, clip);
154 if (pts[0].fX > pts[2].fX) {
155 SkTSwap<SkPoint>(pts[0], pts[2]);
158 SkASSERT(pts[0].fX <= pts[1].fX);
159 SkASSERT(pts[1].fX <= pts[2].fX);
163 if (pts[2].fX <= clip.fLeft) { // wholly to the left
164 this->appendVLine(clip.fLeft, pts[0].fY, pts[2].fY, reverse);
167 if (pts[0].fX >= clip.fRight) { // wholly to the right
169 this->appendVLine(clip.fRight, pts[0].fY, pts[2].fY, reverse);
178 if (pts[0].fX < clip.fLeft) {
179 if (chopMonoQuadAtX(pts, clip.fLeft, &t)) {
180 SkChopQuadAt(pts, tmp, t);
186 pts[0] = tmp[2];
187 pts[1] = tmp[3];
191 this->appendVLine(clip.fLeft, pts[0].fY, pts[2].fY, reverse);
197 if (pts[2].fX > clip.fRight) {
198 if (chopMonoQuadAtX(pts, clip.fRight, &t)) {
199 SkChopQuadAt(pts, tmp, t);
209 this->appendVLine(clip.fRight, pts[0].fY, pts[2].fY, reverse);
212 this->appendQuad(pts, reverse);
277 // Modify pts[] in place so that it is clipped in Y to the clip rect
278 static void chop_cubic_in_Y(SkPoint pts[4], const SkRect& clip) {
281 if (pts[0].fY < clip.fTop) {
283 chop_mono_cubic_at_y(pts, clip.fTop, tmp);
306 pts[0] = tmp[3];
307 pts[1] = tmp[4];
308 pts[2] = tmp[5];
312 if (pts[3].fY > clip.fBottom) {
314 chop_mono_cubic_at_y(pts, clip.fBottom, tmp);
318 pts[1] = tmp[1];
319 pts[2] = tmp[2];
320 pts[3] = tmp[3];
333 SkPoint pts[4];
334 bool reverse = sort_increasing_Y(pts, src, 4);
337 if (pts[3].fY <= clip.fTop || pts[0].fY >= clip.fBottom) {
341 // Now chop so that pts is contained within clip in Y
342 chop_cubic_in_Y(pts, clip);
344 if (pts[0].fX > pts[3].fX) {
345 SkTSwap<SkPoint>(pts[0], pts[3]);
346 SkTSwap<SkPoint>(pts[1], pts[2]);
352 if (pts[3].fX <= clip.fLeft) { // wholly to the left
353 this->appendVLine(clip.fLeft, pts[0].fY, pts[3].fY, reverse);
356 if (pts[0].fX >= clip.fRight) { // wholly to the right
358 this->appendVLine(clip.fRight, pts[0].fY, pts[3].fY, reverse);
364 if (pts[0].fX < clip.fLeft) {
366 chop_mono_cubic_at_x(pts, clip.fLeft, tmp);
375 pts[0] = tmp[3];
376 pts[1] = tmp[4];
377 pts[2] = tmp[5];
381 if (pts[3].fX > clip.fRight) {
383 chop_mono_cubic_at_x(pts, clip.fRight, tmp);
390 this->appendCubic(pts, reverse);
394 static SkRect compute_cubic_bounds(const SkPoint pts[4]) {
396 r.set(pts, 4);
468 void SkEdgeClipper::appendQuad(const SkPoint pts[3], bool reverse) {
472 fCurrPoint[0] = pts[2];
473 fCurrPoint[2] = pts[0];
475 fCurrPoint[0] = pts[0];
476 fCurrPoint[2] = pts[2];
478 fCurrPoint[1] = pts[1];
482 void SkEdgeClipper::appendCubic(const SkPoint pts[4], bool reverse) {
487 fCurrPoint[i] = pts[3 - i];
490 memcpy(fCurrPoint, pts, 4 * sizeof(SkPoint));
495 SkPath::Verb SkEdgeClipper::next(SkPoint pts[]) {
500 memcpy(pts, fCurrPoint, 2 * sizeof(SkPoint));
505 memcpy(pts, fCurrPoint, 3 * sizeof(SkPoint));
510 memcpy(pts, fCurrPoint, 4 * sizeof(SkPoint));
542 void sk_assert_monotonic_y(const SkPoint pts[], int count) {
544 assert_monotonic(&pts[0].fY, count);
548 void sk_assert_monotonic_x(const SkPoint pts[], int count) {
550 assert_monotonic(&pts[0].fX, count);