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
152 this->appendVLine(clip.fRight, pts[0].fY, pts[2].fY, reverse);
161 if (pts[0].fX < clip.fLeft) {
162 if (chopMonoQuadAtX(pts, clip.fLeft, &t)) {
163 SkChopQuadAt(pts, tmp, t);
169 pts[0] = tmp[2];
170 pts[1] = tmp[3];
174 this->appendVLine(clip.fLeft, pts[0].fY, pts[2].fY, reverse);
180 if (pts[2].fX > clip.fRight) {
181 if (chopMonoQuadAtX(pts, clip.fRight, &t)) {
182 SkChopQuadAt(pts, tmp, t);
192 this->appendVLine(clip.fRight, pts[0].fY, pts[2].fY, reverse);
195 this->appendQuad(pts, reverse);
228 // Modify pts[] in place so that it is clipped in Y to the clip rect
229 static void chop_cubic_in_Y(SkPoint pts[4], const SkRect& clip) {
232 if (pts[0].fY < clip.fTop) {
234 if (SkChopMonoCubicAtY(pts, clip.fTop, tmp)) {
241 pts[0] = tmp[3];
242 pts[1] = tmp[4];
243 pts[2] = tmp[5];
248 clamp_ge(pts[i].fY, clip.fTop);
254 if (pts[3].fY > clip.fBottom) {
256 if (SkChopMonoCubicAtY(pts, clip.fBottom, tmp)) {
260 pts[1] = tmp[1];
261 pts[2] = tmp[2];
262 pts[3] = tmp[3];
267 clamp_le(pts[i].fY, clip.fBottom);
275 SkPoint pts[4];
276 bool reverse = sort_increasing_Y(pts, src, 4);
279 if (pts[3].fY <= clip.fTop || pts[0].fY >= clip.fBottom) {
283 // Now chop so that pts is contained within clip in Y
284 chop_cubic_in_Y(pts, clip);
286 if (pts[0].fX > pts[3].fX) {
287 SkTSwap<SkPoint>(pts[0], pts[3]);
288 SkTSwap<SkPoint>(pts[1], pts[2]);
294 if (pts[3].fX <= clip.fLeft) { // wholly to the left
295 this->appendVLine(clip.fLeft, pts[0].fY, pts[3].fY, reverse);
298 if (pts[0].fX >= clip.fRight) { // wholly to the right
300 this->appendVLine(clip.fRight, pts[0].fY, pts[3].fY, reverse);
306 if (pts[0].fX < clip.fLeft) {
308 if (SkChopMonoCubicAtX(pts, clip.fLeft, tmp)) {
317 pts[0] = tmp[3];
318 pts[1] = tmp[4];
319 pts[2] = tmp[5];
323 this->appendVLine(clip.fLeft, pts[0].fY, pts[3].fY, reverse);
329 if (pts[3].fX > clip.fRight) {
331 if (SkChopMonoCubicAtX(pts, clip.fRight, tmp)) {
340 this->appendVLine(clip.fRight, pts[0].fY, pts[3].fY, reverse);
343 this->appendCubic(pts, reverse);
388 void SkEdgeClipper::appendQuad(const SkPoint pts[3], bool reverse) {
392 fCurrPoint[0] = pts[2];
393 fCurrPoint[2] = pts[0];
395 fCurrPoint[0] = pts[0];
396 fCurrPoint[2] = pts[2];
398 fCurrPoint[1] = pts[1];
402 void SkEdgeClipper::appendCubic(const SkPoint pts[4], bool reverse) {
407 fCurrPoint[i] = pts[3 - i];
410 memcpy(fCurrPoint, pts, 4 * sizeof(SkPoint));
415 SkPath::Verb SkEdgeClipper::next(SkPoint pts[]) {
420 memcpy(pts, fCurrPoint, 2 * sizeof(SkPoint));
425 memcpy(pts, fCurrPoint, 3 * sizeof(SkPoint));
430 memcpy(pts, fCurrPoint, 4 * sizeof(SkPoint));
462 void sk_assert_monotonic_y(const SkPoint pts[], int count) {
464 assert_monotonic(&pts[0].fY, count);
468 void sk_assert_monotonic_x(const SkPoint pts[], int count) {
470 assert_monotonic(&pts[0].fX, count);