Home | History | Annotate | Download | only in core

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);
260 // Modify pts[] in place so that it is clipped in Y to the clip rect
261 static void chop_cubic_in_Y(SkPoint pts[4], const SkRect& clip) {
264 if (pts[0].fY < clip.fTop) {
266 chop_mono_cubic_at_y(pts, clip.fTop, tmp);
273 pts[0] = tmp[3];
274 pts[1] = tmp[4];
275 pts[2] = tmp[5];
279 if (pts[3].fY > clip.fBottom) {
281 chop_mono_cubic_at_y(pts, clip.fBottom, tmp);
285 pts[1] = tmp[1];
286 pts[2] = tmp[2];
287 pts[3] = tmp[3];
300 SkPoint pts[4];
301 bool reverse = sort_increasing_Y(pts, src, 4);
304 if (pts[3].fY <= clip.fTop || pts[0].fY >= clip.fBottom) {
308 // Now chop so that pts is contained within clip in Y
309 chop_cubic_in_Y(pts, clip);
311 if (pts[0].fX > pts[3].fX) {
312 SkTSwap<SkPoint>(pts[0], pts[3]);
313 SkTSwap<SkPoint>(pts[1], pts[2]);
319 if (pts[3].fX <= clip.fLeft) { // wholly to the left
320 this->appendVLine(clip.fLeft, pts[0].fY, pts[3].fY, reverse);
323 if (pts[0].fX >= clip.fRight) { // wholly to the right
325 this->appendVLine(clip.fRight, pts[0].fY, pts[3].fY, reverse);
331 if (pts[0].fX < clip.fLeft) {
333 chop_mono_cubic_at_x(pts, clip.fLeft, tmp);
342 pts[0] = tmp[3];
343 pts[1] = tmp[4];
344 pts[2] = tmp[5];
348 if (pts[3].fX > clip.fRight) {
350 chop_mono_cubic_at_x(pts, clip.fRight, tmp);
357 this->appendCubic(pts, reverse);
361 static bool quick_reject_in_y(const SkPoint pts[4], const SkRect& clip) {
362 Sk4s ys(pts[0].fY, pts[1].fY, pts[2].fY, pts[3].fY);
407 void SkEdgeClipper::appendQuad(const SkPoint pts[3], bool reverse) {
411 fCurrPoint[0] = pts[2];
412 fCurrPoint[2] = pts[0];
414 fCurrPoint[0] = pts[0];
415 fCurrPoint[2] = pts[2];
417 fCurrPoint[1] = pts[1];
421 void SkEdgeClipper::appendCubic(const SkPoint pts[4], bool reverse) {
426 fCurrPoint[i] = pts[3 - i];
429 memcpy(fCurrPoint, pts, 4 * sizeof(SkPoint));
434 SkPath::Verb SkEdgeClipper::next(SkPoint pts[]) {
439 memcpy(pts, fCurrPoint, 2 * sizeof(SkPoint));
444 memcpy(pts, fCurrPoint, 3 * sizeof(SkPoint));
449 memcpy(pts, fCurrPoint, 4 * sizeof(SkPoint));
481 void sk_assert_monotonic_y(const SkPoint pts[], int count) {
483 assert_monotonic(&pts[0].fY, count);
487 void sk_assert_monotonic_x(const SkPoint pts[], int count) {
489 assert_monotonic(&pts[0].fX, count);