Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(365)

Side by Side Diff: src/pathops/SkPathOpsTSect.h

Issue 2357353002: split tight quads and cubics (Closed)
Patch Set: fix linux build Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/pathops/SkPathOpsOp.cpp ('k') | src/pathops/SkReduceOrder.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 #ifndef SkPathOpsTSect_DEFINED 7 #ifndef SkPathOpsTSect_DEFINED
8 #define SkPathOpsTSect_DEFINED 8 #define SkPathOpsTSect_DEFINED
9 9
10 #include "SkChunkAlloc.h" 10 #include "SkChunkAlloc.h"
(...skipping 1513 matching lines...) Expand 10 before | Expand all | Expand 10 after
1524 double tStep = tEnd - tStart; 1524 double tStep = tEnd - tStart;
1525 SkDPoint workPt; 1525 SkDPoint workPt;
1526 do { 1526 do {
1527 tStep *= 0.5; 1527 tStep *= 0.5;
1528 if (precisely_zero(tStep)) { 1528 if (precisely_zero(tStep)) {
1529 return 0; 1529 return 0;
1530 } 1530 }
1531 workT += tStep; 1531 workT += tStep;
1532 workPt = fCurve.ptAtT(workT); 1532 workPt = fCurve.ptAtT(workT);
1533 coinW.setPerp(fCurve, workT, workPt, opp->fCurve); 1533 coinW.setPerp(fCurve, workT, workPt, opp->fCurve);
1534 if (coinW.perpT() < 0) { 1534 double perpT = coinW.perpT();
1535 if (coinW.isCoincident() ? !between(oppSpan->fStartT, perpT, oppSpan->fE ndT) : perpT < 0) {
1535 continue; 1536 continue;
1536 } 1537 }
1537 SkDVector perpW = workPt - coinW.perpPt(); 1538 SkDVector perpW = workPt - coinW.perpPt();
1538 if ((perpS.dot(perpW) >= 0) == (tStep < 0)) { 1539 if ((perpS.dot(perpW) >= 0) == (tStep < 0)) {
1539 tStep = -tStep; 1540 tStep = -tStep;
1540 } 1541 }
1541 if (workPt.approximatelyEqual(coinW.perpPt())) { 1542 if (workPt.approximatelyEqual(coinW.perpPt())) {
1542 break; 1543 break;
1543 } 1544 }
1544 } while (true); 1545 } while (true);
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after
2316 --last; 2317 --last;
2317 } else { 2318 } else {
2318 intersections->setCoincident(index++); 2319 intersections->setCoincident(index++);
2319 } 2320 }
2320 intersections->setCoincident(index); 2321 intersections->setCoincident(index);
2321 } 2322 }
2322 SkASSERT(intersections->used() <= TCurve::kMaxIntersections); 2323 SkASSERT(intersections->used() <= TCurve::kMaxIntersections);
2323 } 2324 }
2324 2325
2325 #endif 2326 #endif
OLDNEW
« no previous file with comments | « src/pathops/SkPathOpsOp.cpp ('k') | src/pathops/SkReduceOrder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698