Lines Matching refs:pts

67 static bool chopMonoQuadAtY(SkPoint pts[3], SkScalar y, SkScalar* t) {
68 return chopMonoQuadAt(pts[0].fY, pts[1].fY, pts[2].fY, y, t);
71 static bool chopMonoQuadAtX(SkPoint pts[3], SkScalar x, SkScalar* t) {
72 return chopMonoQuadAt(pts[0].fX, pts[1].fX, pts[2].fX, x, t);
75 // Modify pts[] in place so that it is clipped in Y to the clip rect
76 static void chop_quad_in_Y(SkPoint pts[3], const SkRect& clip) {
81 if (pts[0].fY < clip.fTop) {
82 if (chopMonoQuadAtY(pts, clip.fTop, &t)) {
84 SkChopQuadAt(pts, tmp, t);
87 pts[0] = tmp[2];
88 pts[1] = tmp[3];
93 if (pts[i].fY < clip.fTop) {
94 pts[i].fY = clip.fTop;
101 if (pts[2].fY > clip.fBottom) {
102 if (chopMonoQuadAtY(pts, clip.fBottom, &t)) {
103 SkChopQuadAt(pts, tmp, t);
106 pts[1] = tmp[1];
107 pts[2] = tmp[2];
112 if (pts[i].fY > clip.fBottom) {
113 pts[i].fY = clip.fBottom;
122 SkPoint pts[3];
123 bool reverse = sort_increasing_Y(pts, srcPts, 3);
126 if (pts[2].fY <= clip.fTop || pts[0].fY >= clip.fBottom) {
130 // Now chop so that pts is contained within clip in Y
131 chop_quad_in_Y(pts, clip);
133 if (pts[0].fX > pts[2].fX) {
134 SkTSwap<SkPoint>(pts[0], pts[2]);
137 SkASSERT(pts[0].fX <= pts[1].fX);
138 SkASSERT(pts[1].fX <= pts[2].fX);
142 if (pts[2].fX <= clip.fLeft) { // wholly to the left
143 this->appendVLine(clip.fLeft, pts[0].fY, pts[2].fY, reverse);
146 if (pts[0].fX >= clip.fRight) { // wholly to the right
147 this->appendVLine(clip.fRight, pts[0].fY, pts[2].fY, reverse);
155 if (pts[0].fX < clip.fLeft) {
156 if (chopMonoQuadAtX(pts, clip.fLeft, &t)) {
157 SkChopQuadAt(pts, tmp, t);
161 pts[0] = tmp[2];
162 pts[1] = tmp[3];
166 this->appendVLine(clip.fLeft, pts[0].fY, pts[2].fY, reverse);
172 if (pts[2].fX > clip.fRight) {
173 if (chopMonoQuadAtX(pts, clip.fRight, &t)) {
174 SkChopQuadAt(pts, tmp, t);
182 this->appendVLine(clip.fRight, pts[0].fY, pts[2].fY, reverse);
185 this->appendQuad(pts, reverse);
259 static bool chopMonoCubicAtY(SkPoint pts[4], SkScalar y, SkScalar* t) {
260 return chopMonoCubicAt(pts[0].fY, pts[1].fY, pts[2].fY, pts[3].fY, y, t);
263 static bool chopMonoCubicAtX(SkPoint pts[4], SkScalar x, SkScalar* t) {
264 return chopMonoCubicAt(pts[0].fX, pts[1].fX, pts[2].fX, pts[3].fX, x, t);
267 // Modify pts[] in place so that it is clipped in Y to the clip rect
268 static void chop_cubic_in_Y(SkPoint pts[4], const SkRect& clip) {
271 if (pts[0].fY < clip.fTop) {
273 if (chopMonoCubicAtY(pts, clip.fTop, &t)) {
275 SkChopCubicAt(pts, tmp, t);
284 pts[0] = tmp[3];
285 pts[1] = tmp[4];
286 pts[2] = tmp[5];
291 clamp_ge(pts[i].fY, clip.fTop);
297 if (pts[3].fY > clip.fBottom) {
299 if (chopMonoCubicAtY(pts, clip.fBottom, &t)) {
301 SkChopCubicAt(pts, tmp, t);
305 pts[1] = tmp[1];
306 pts[2] = tmp[2];
307 pts[3] = tmp[3];
312 clamp_le(pts[i].fY, clip.fBottom);
320 SkPoint pts[4];
321 bool reverse = sort_increasing_Y(pts, src, 4);
324 if (pts[3].fY <= clip.fTop || pts[0].fY >= clip.fBottom) {
328 // Now chop so that pts is contained within clip in Y
329 chop_cubic_in_Y(pts, clip);
331 if (pts[0].fX > pts[3].fX) {
332 SkTSwap<SkPoint>(pts[0], pts[3]);
333 SkTSwap<SkPoint>(pts[1], pts[2]);
339 if (pts[3].fX <= clip.fLeft) { // wholly to the left
340 this->appendVLine(clip.fLeft, pts[0].fY, pts[3].fY, reverse);
343 if (pts[0].fX >= clip.fRight) { // wholly to the right
344 this->appendVLine(clip.fRight, pts[0].fY, pts[3].fY, reverse);
349 if (pts[0].fX < clip.fLeft) {
351 if (chopMonoCubicAtX(pts, clip.fLeft, &t)) {
353 SkChopCubicAt(pts, tmp, t);
363 pts[0] = tmp[3];
364 pts[1] = tmp[4];
365 pts[2] = tmp[5];
369 this->appendVLine(clip.fLeft, pts[0].fY, pts[3].fY, reverse);
375 if (pts[3].fX > clip.fRight) {
377 if (chopMonoCubicAtX(pts, clip.fRight, &t)) {
379 SkChopCubicAt(pts, tmp, t);
388 this->appendVLine(clip.fRight, pts[0].fY, pts[3].fY, reverse);
391 this->appendCubic(pts, reverse);
439 void SkEdgeClipper::appendQuad(const SkPoint pts[3], bool reverse) {
443 fCurrPoint[0] = pts[2];
444 fCurrPoint[2] = pts[0];
446 fCurrPoint[0] = pts[0];
447 fCurrPoint[2] = pts[2];
449 fCurrPoint[1] = pts[1];
453 void SkEdgeClipper::appendCubic(const SkPoint pts[4], bool reverse) {
458 fCurrPoint[i] = pts[3 - i];
461 memcpy(fCurrPoint, pts, 4 * sizeof(SkPoint));
466 SkPath::Verb SkEdgeClipper::next(SkPoint pts[]) {
471 memcpy(pts, fCurrPoint, 2 * sizeof(SkPoint));
476 memcpy(pts, fCurrPoint, 3 * sizeof(SkPoint));
481 memcpy(pts, fCurrPoint, 4 * sizeof(SkPoint));
513 void sk_assert_monotonic_y(const SkPoint pts[], int count) {
515 assert_monotonic(&pts[0].fY, count);
519 void sk_assert_monotonic_x(const SkPoint pts[], int count) {
521 assert_monotonic(&pts[0].fX, count);