Home | History | Annotate | Download | only in core

Lines Matching refs:pts

74 static bool chopMonoQuadAtY(SkPoint pts[3], SkScalar y, SkScalar* t) {
75 return chopMonoQuadAt(pts[0].fY, pts[1].fY, pts[2].fY, y, t);
78 static bool chopMonoQuadAtX(SkPoint pts[3], SkScalar x, SkScalar* t) {
79 return chopMonoQuadAt(pts[0].fX, pts[1].fX, pts[2].fX, x, t);
82 // Modify pts[] in place so that it is clipped in Y to the clip rect
83 static void chop_quad_in_Y(SkPoint pts[3], const SkRect& clip) {
88 if (pts[0].fY < clip.fTop) {
89 if (chopMonoQuadAtY(pts, clip.fTop, &t)) {
91 SkChopQuadAt(pts, tmp, t);
94 pts[0] = tmp[2];
95 pts[1] = tmp[3];
100 if (pts[i].fY < clip.fTop) {
101 pts[i].fY = clip.fTop;
108 if (pts[2].fY > clip.fBottom) {
109 if (chopMonoQuadAtY(pts, clip.fBottom, &t)) {
110 SkChopQuadAt(pts, tmp, t);
113 pts[1] = tmp[1];
114 pts[2] = tmp[2];
119 if (pts[i].fY > clip.fBottom) {
120 pts[i].fY = clip.fBottom;
129 SkPoint pts[3];
130 bool reverse = sort_increasing_Y(pts, srcPts, 3);
133 if (pts[2].fY <= clip.fTop || pts[0].fY >= clip.fBottom) {
137 // Now chop so that pts is contained within clip in Y
138 chop_quad_in_Y(pts, clip);
140 if (pts[0].fX > pts[2].fX) {
141 SkTSwap<SkPoint>(pts[0], pts[2]);
144 SkASSERT(pts[0].fX <= pts[1].fX);
145 SkASSERT(pts[1].fX <= pts[2].fX);
149 if (pts[2].fX <= clip.fLeft) { // wholly to the left
150 this->appendVLine(clip.fLeft, pts[0].fY, pts[2].fY, reverse);
153 if (pts[0].fX >= clip.fRight) { // wholly to the right
154 this->appendVLine(clip.fRight, pts[0].fY, pts[2].fY, reverse);
162 if (pts[0].fX < clip.fLeft) {
163 if (chopMonoQuadAtX(pts, clip.fLeft, &t)) {
164 SkChopQuadAt(pts, tmp, t);
168 pts[0] = tmp[2];
169 pts[1] = tmp[3];
173 this->appendVLine(clip.fLeft, pts[0].fY, pts[2].fY, reverse);
179 if (pts[2].fX > clip.fRight) {
180 if (chopMonoQuadAtX(pts, clip.fRight, &t)) {
181 SkChopQuadAt(pts, tmp, t);
189 this->appendVLine(clip.fRight, pts[0].fY, pts[2].fY, reverse);
192 this->appendQuad(pts, reverse);
266 static bool chopMonoCubicAtY(SkPoint pts[4], SkScalar y, SkScalar* t) {
267 return chopMonoCubicAt(pts[0].fY, pts[1].fY, pts[2].fY, pts[3].fY, y, t);
270 static bool chopMonoCubicAtX(SkPoint pts[4], SkScalar x, SkScalar* t) {
271 return chopMonoCubicAt(pts[0].fX, pts[1].fX, pts[2].fX, pts[3].fX, x, t);
274 // Modify pts[] in place so that it is clipped in Y to the clip rect
275 static void chop_cubic_in_Y(SkPoint pts[4], const SkRect& clip) {
280 if (pts[0].fY < clip.fTop) {
281 if (chopMonoCubicAtY(pts, clip.fTop, &t)) {
282 SkChopCubicAt(pts, tmp, t);
290 pts[0] = tmp[3];
291 pts[1] = tmp[4];
292 pts[2] = tmp[5];
297 clamp_ge(pts[i].fY, clip.fTop);
303 if (pts[3].fY > clip.fBottom) {
304 if (chopMonoCubicAtY(pts, clip.fBottom, &t)) {
305 SkChopCubicAt(pts, tmp, t);
309 pts[1] = tmp[1];
310 pts[2] = tmp[2];
311 pts[3] = tmp[3];
316 clamp_le(pts[i].fY, clip.fBottom);
324 SkPoint pts[4];
325 bool reverse = sort_increasing_Y(pts, src, 4);
328 if (pts[3].fY <= clip.fTop || pts[0].fY >= clip.fBottom) {
332 // Now chop so that pts is contained within clip in Y
333 chop_cubic_in_Y(pts, clip);
335 if (pts[0].fX > pts[3].fX) {
336 SkTSwap<SkPoint>(pts[0], pts[3]);
337 SkTSwap<SkPoint>(pts[1], pts[2]);
343 if (pts[3].fX <= clip.fLeft) { // wholly to the left
344 this->appendVLine(clip.fLeft, pts[0].fY, pts[3].fY, reverse);
347 if (pts[0].fX >= clip.fRight) { // wholly to the right
348 this->appendVLine(clip.fRight, pts[0].fY, pts[3].fY, reverse);
356 if (pts[0].fX < clip.fLeft) {
357 if (chopMonoCubicAtX(pts, clip.fLeft, &t)) {
358 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) {
376 if (chopMonoCubicAtX(pts, clip.fRight, &t)) {
377 SkChopCubicAt(pts, tmp, t);
386 this->appendVLine(clip.fRight, pts[0].fY, pts[3].fY, reverse);
389 this->appendCubic(pts, reverse);
437 void SkEdgeClipper::appendQuad(const SkPoint pts[3], bool reverse) {
441 fCurrPoint[0] = pts[2];
442 fCurrPoint[2] = pts[0];
444 fCurrPoint[0] = pts[0];
445 fCurrPoint[2] = pts[2];
447 fCurrPoint[1] = pts[1];
451 void SkEdgeClipper::appendCubic(const SkPoint pts[4], bool reverse) {
456 fCurrPoint[i] = pts[3 - i];
459 memcpy(fCurrPoint, pts, 4 * sizeof(SkPoint));
464 SkPath::Verb SkEdgeClipper::next(SkPoint pts[]) {
469 memcpy(pts, fCurrPoint, 2 * sizeof(SkPoint));
474 memcpy(pts, fCurrPoint, 3 * sizeof(SkPoint));
479 memcpy(pts, fCurrPoint, 4 * sizeof(SkPoint));
511 void sk_assert_monotonic_y(const SkPoint pts[], int count) {
513 assert_monotonic(&pts[0].fY, count);
517 void sk_assert_monotonic_x(const SkPoint pts[], int count) {
519 assert_monotonic(&pts[0].fX, count);