Lines Matching refs:pts

53     const SkPoint pts[] = { p0, p1 };
54 int lineCount = SkLineClipper::ClipLine(pts, clip, lines, fCanCullToTheRight);
86 static bool chopMonoQuadAtY(SkPoint pts[3], SkScalar y, SkScalar* t) {
87 return chopMonoQuadAt(pts[0].fY, pts[1].fY, pts[2].fY, y, t);
90 static bool chopMonoQuadAtX(SkPoint pts[3], SkScalar x, SkScalar* t) {
91 return chopMonoQuadAt(pts[0].fX, pts[1].fX, pts[2].fX, x, t);
94 // Modify pts[] in place so that it is clipped in Y to the clip rect
95 static void chop_quad_in_Y(SkPoint pts[3], const SkRect& clip) {
100 if (pts[0].fY < clip.fTop) {
101 if (chopMonoQuadAtY(pts, clip.fTop, &t)) {
103 SkChopQuadAt(pts, tmp, t);
108 pts[0] = tmp[2];
109 pts[1] = tmp[3];
114 if (pts[i].fY < clip.fTop) {
115 pts[i].fY = clip.fTop;
122 if (pts[2].fY > clip.fBottom) {
123 if (chopMonoQuadAtY(pts, clip.fBottom, &t)) {
124 SkChopQuadAt(pts, tmp, t);
129 pts[1] = tmp[1];
130 pts[2] = tmp[2];
135 if (pts[i].fY > clip.fBottom) {
136 pts[i].fY = clip.fBottom;
145 SkPoint pts[3];
146 bool reverse = sort_increasing_Y(pts, srcPts, 3);
149 if (pts[2].fY <= clip.fTop || pts[0].fY >= clip.fBottom) {
153 // Now chop so that pts is contained within clip in Y
154 chop_quad_in_Y(pts, clip);
156 if (pts[0].fX > pts[2].fX) {
158 swap(pts[0], pts[2]);
161 SkASSERT(pts[0].fX <= pts[1].fX);
162 SkASSERT(pts[1].fX <= pts[2].fX);
166 if (pts[2].fX <= clip.fLeft) { // wholly to the left
167 this->appendVLine(clip.fLeft, pts[0].fY, pts[2].fY, reverse);
170 if (pts[0].fX >= clip.fRight) { // wholly to the right
172 this->appendVLine(clip.fRight, pts[0].fY, pts[2].fY, reverse);
181 if (pts[0].fX < clip.fLeft) {
182 if (chopMonoQuadAtX(pts, clip.fLeft, &t)) {
183 SkChopQuadAt(pts, tmp, t);
189 pts[0] = tmp[2];
190 pts[1] = tmp[3];
194 this->appendVLine(clip.fLeft, pts[0].fY, pts[2].fY, reverse);
200 if (pts[2].fX > clip.fRight) {
201 if (chopMonoQuadAtX(pts, clip.fRight, &t)) {
202 SkChopQuadAt(pts, tmp, t);
212 pts[1].fX = std::min(pts[1].fX, clip.fRight);
213 pts[2].fX = std::min(pts[2].fX, clip.fRight);
214 this->appendQuad(pts, reverse);
217 this->appendQuad(pts, reverse);
282 // Modify pts[] in place so that it is clipped in Y to the clip rect
283 static void chop_cubic_in_Y(SkPoint pts[4], const SkRect& clip) {
286 if (pts[0].fY < clip.fTop) {
288 chop_mono_cubic_at_y(pts, clip.fTop, tmp);
311 pts[0] = tmp[3];
312 pts[1] = tmp[4];
313 pts[2] = tmp[5];
317 if (pts[3].fY > clip.fBottom) {
319 chop_mono_cubic_at_y(pts, clip.fBottom, tmp);
323 pts[1] = tmp[1];
324 pts[2] = tmp[2];
325 pts[3] = tmp[3];
338 SkPoint pts[4];
339 bool reverse = sort_increasing_Y(pts, src, 4);
342 if (pts[3].fY <= clip.fTop || pts[0].fY >= clip.fBottom) {
346 // Now chop so that pts is contained within clip in Y
347 chop_cubic_in_Y(pts, clip);
349 if (pts[0].fX > pts[3].fX) {
351 swap(pts[0], pts[3]);
352 swap(pts[1], pts[2]);
358 if (pts[3].fX <= clip.fLeft) { // wholly to the left
359 this->appendVLine(clip.fLeft, pts[0].fY, pts[3].fY, reverse);
362 if (pts[0].fX >= clip.fRight) { // wholly to the right
364 this->appendVLine(clip.fRight, pts[0].fY, pts[3].fY, reverse);
370 if (pts[0].fX < clip.fLeft) {
372 chop_mono_cubic_at_x(pts, clip.fLeft, tmp);
381 pts[0] = tmp[3];
382 pts[1] = tmp[4];
383 pts[2] = tmp[5];
387 if (pts[3].fX > clip.fRight) {
389 chop_mono_cubic_at_x(pts, clip.fRight, tmp);
396 this->appendCubic(pts, reverse);
400 static SkRect compute_cubic_bounds(const SkPoint pts[4]) {
402 r.setBounds(pts, 4);
474 void SkEdgeClipper::appendQuad(const SkPoint pts[3], bool reverse) {
478 fCurrPoint[0] = pts[2];
479 fCurrPoint[2] = pts[0];
481 fCurrPoint[0] = pts[0];
482 fCurrPoint[2] = pts[2];
484 fCurrPoint[1] = pts[1];
488 void SkEdgeClipper::appendCubic(const SkPoint pts[4], bool reverse) {
493 fCurrPoint[i] = pts[3 - i];
496 memcpy(fCurrPoint, pts, 4 * sizeof(SkPoint));
501 SkPath::Verb SkEdgeClipper::next(SkPoint pts[]) {
506 memcpy(pts, fCurrPoint, 2 * sizeof(SkPoint));
511 memcpy(pts, fCurrPoint, 3 * sizeof(SkPoint));
516 memcpy(pts, fCurrPoint, 4 * sizeof(SkPoint));
548 void sk_assert_monotonic_y(const SkPoint pts[], int count) {
550 assert_monotonic(&pts[0].fY, count);
554 void sk_assert_monotonic_x(const SkPoint pts[], int count) {
556 assert_monotonic(&pts[0].fX, count);