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);
89 pts[0] = tmp[2];
90 pts[1] = tmp[3];
95 if (pts[i].fY < clip.fTop) {
96 pts[i].fY = clip.fTop;
103 if (pts[2].fY > clip.fBottom) {
104 if (chopMonoQuadAtY(pts, clip.fBottom, &t)) {
105 SkChopQuadAt(pts, tmp, t);
110 pts[1] = tmp[1];
111 pts[2] = tmp[2];
116 if (pts[i].fY > clip.fBottom) {
117 pts[i].fY = clip.fBottom;
126 SkPoint pts[3];
127 bool reverse = sort_increasing_Y(pts, srcPts, 3);
130 if (pts[2].fY <= clip.fTop || pts[0].fY >= clip.fBottom) {
134 // Now chop so that pts is contained within clip in Y
135 chop_quad_in_Y(pts, clip);
137 if (pts[0].fX > pts[2].fX) {
138 SkTSwap<SkPoint>(pts[0], pts[2]);
141 SkASSERT(pts[0].fX <= pts[1].fX);
142 SkASSERT(pts[1].fX <= pts[2].fX);
146 if (pts[2].fX <= clip.fLeft) { // wholly to the left
147 this->appendVLine(clip.fLeft, pts[0].fY, pts[2].fY, reverse);
150 if (pts[0].fX >= clip.fRight) { // wholly to the right
151 this->appendVLine(clip.fRight, pts[0].fY, pts[2].fY, reverse);
159 if (pts[0].fX < clip.fLeft) {
160 if (chopMonoQuadAtX(pts, clip.fLeft, &t)) {
161 SkChopQuadAt(pts, tmp, t);
167 pts[0] = tmp[2];
168 pts[1] = tmp[3];
172 this->appendVLine(clip.fLeft, pts[0].fY, pts[2].fY, reverse);
178 if (pts[2].fX > clip.fRight) {
179 if (chopMonoQuadAtX(pts, clip.fRight, &t)) {
180 SkChopQuadAt(pts, tmp, t);
190 this->appendVLine(clip.fRight, pts[0].fY, pts[2].fY, reverse);
193 this->appendQuad(pts, reverse);
268 static bool chopMonoCubicAtY(SkPoint pts[4], SkScalar y, SkScalar* t) {
269 return chopMonoCubicAt(pts[0].fY, pts[1].fY, pts[2].fY, pts[3].fY, y, t);
272 static bool chopMonoCubicAtX(SkPoint pts[4], SkScalar x, SkScalar* t) {
273 return chopMonoCubicAt(pts[0].fX, pts[1].fX, pts[2].fX, pts[3].fX, x, t);
276 // Modify pts[] in place so that it is clipped in Y to the clip rect
277 static void chop_cubic_in_Y(SkPoint pts[4], const SkRect& clip) {
280 if (pts[0].fY < clip.fTop) {
282 if (chopMonoCubicAtY(pts, clip.fTop, &t)) {
284 SkChopCubicAt(pts, tmp, t);
293 pts[0] = tmp[3];
294 pts[1] = tmp[4];
295 pts[2] = tmp[5];
300 clamp_ge(pts[i].fY, clip.fTop);
306 if (pts[3].fY > clip.fBottom) {
308 if (chopMonoCubicAtY(pts, clip.fBottom, &t)) {
310 SkChopCubicAt(pts, tmp, t);
314 pts[1] = tmp[1];
315 pts[2] = tmp[2];
316 pts[3] = tmp[3];
321 clamp_le(pts[i].fY, clip.fBottom);
329 SkPoint pts[4];
330 bool reverse = sort_increasing_Y(pts, src, 4);
333 if (pts[3].fY <= clip.fTop || pts[0].fY >= clip.fBottom) {
337 // Now chop so that pts is contained within clip in Y
338 chop_cubic_in_Y(pts, clip);
340 if (pts[0].fX > pts[3].fX) {
341 SkTSwap<SkPoint>(pts[0], pts[3]);
342 SkTSwap<SkPoint>(pts[1], pts[2]);
348 if (pts[3].fX <= clip.fLeft) { // wholly to the left
349 this->appendVLine(clip.fLeft, pts[0].fY, pts[3].fY, reverse);
352 if (pts[0].fX >= clip.fRight) { // wholly to the right
353 this->appendVLine(clip.fRight, pts[0].fY, pts[3].fY, reverse);
358 if (pts[0].fX < clip.fLeft) {
360 if (chopMonoCubicAtX(pts, clip.fLeft, &t)) {
362 SkChopCubicAt(pts, tmp, t);
372 pts[0] = tmp[3];
373 pts[1] = tmp[4];
374 pts[2] = tmp[5];
378 this->appendVLine(clip.fLeft, pts[0].fY, pts[3].fY, reverse);
384 if (pts[3].fX > clip.fRight) {
386 if (chopMonoCubicAtX(pts, clip.fRight, &t)) {
388 SkChopCubicAt(pts, tmp, t);
398 this->appendVLine(clip.fRight, pts[0].fY, pts[3].fY, reverse);
401 this->appendCubic(pts, reverse);
446 void SkEdgeClipper::appendQuad(const SkPoint pts[3], bool reverse) {
450 fCurrPoint[0] = pts[2];
451 fCurrPoint[2] = pts[0];
453 fCurrPoint[0] = pts[0];
454 fCurrPoint[2] = pts[2];
456 fCurrPoint[1] = pts[1];
460 void SkEdgeClipper::appendCubic(const SkPoint pts[4], bool reverse) {
465 fCurrPoint[i] = pts[3 - i];
468 memcpy(fCurrPoint, pts, 4 * sizeof(SkPoint));
473 SkPath::Verb SkEdgeClipper::next(SkPoint pts[]) {
478 memcpy(pts, fCurrPoint, 2 * sizeof(SkPoint));
483 memcpy(pts, fCurrPoint, 3 * sizeof(SkPoint));
488 memcpy(pts, fCurrPoint, 4 * sizeof(SkPoint));
520 void sk_assert_monotonic_y(const SkPoint pts[], int count) {
522 assert_monotonic(&pts[0].fY, count);
526 void sk_assert_monotonic_x(const SkPoint pts[], int count) {
528 assert_monotonic(&pts[0].fX, count);