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

Side by Side Diff: src/pathops/SkOpAngle.cpp

Issue 2237223002: pathops coincident work (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove unused code 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/SkOpAngle.h ('k') | src/pathops/SkOpCoincidence.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 2012 Google Inc. 2 * Copyright 2012 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 #include "SkOpAngle.h" 7 #include "SkOpAngle.h"
8 #include "SkOpSegment.h" 8 #include "SkOpSegment.h"
9 #include "SkPathOpsCurve.h" 9 #include "SkPathOpsCurve.h"
10 #include "SkTSort.h" 10 #include "SkTSort.h"
(...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after
898 SkDEBUGCODE(fCurvePart[2].fX = fCurvePart[2].fY = fCurvePart[3].fX = fCurveP art[3].fY 898 SkDEBUGCODE(fCurvePart[2].fX = fCurvePart[2].fY = fCurvePart[3].fX = fCurveP art[3].fY
899 = SK_ScalarNaN); 899 = SK_ScalarNaN);
900 SkDEBUGCODE(fCurvePart.fVerb = segment->verb()); 900 SkDEBUGCODE(fCurvePart.fVerb = segment->verb());
901 segment->subDivide(fStart, fEnd, &fCurvePart); 901 segment->subDivide(fStart, fEnd, &fCurvePart);
902 fOriginalCurvePart = fCurvePart; 902 fOriginalCurvePart = fCurvePart;
903 setCurveHullSweep(); 903 setCurveHullSweep();
904 const SkPath::Verb verb = segment->verb(); 904 const SkPath::Verb verb = segment->verb();
905 if (verb != SkPath::kLine_Verb 905 if (verb != SkPath::kLine_Verb
906 && !(fIsCurve = fSweep[0].crossCheck(fSweep[1]) != 0)) { 906 && !(fIsCurve = fSweep[0].crossCheck(fSweep[1]) != 0)) {
907 SkDLine lineHalf; 907 SkDLine lineHalf;
908 fCurvePart[1] = fCurvePart[SkPathOpsVerbToPoints(verb)];
909 fOriginalCurvePart[1] = fCurvePart[1];
908 lineHalf[0].set(fCurvePart[0].asSkPoint()); 910 lineHalf[0].set(fCurvePart[0].asSkPoint());
909 lineHalf[1].set(fCurvePart[SkPathOpsVerbToPoints(verb)].asSkPoint()); 911 lineHalf[1].set(fCurvePart[1].asSkPoint());
910 fTangentHalf.lineEndPoints(lineHalf); 912 fTangentHalf.lineEndPoints(lineHalf);
911 fSide = 0; 913 fSide = 0;
912 } 914 }
913 switch (verb) { 915 switch (verb) {
914 case SkPath::kLine_Verb: { 916 case SkPath::kLine_Verb: {
915 SkASSERT(fStart != fEnd); 917 SkASSERT(fStart != fEnd);
916 const SkPoint& cP1 = pts[fStart->t() < fEnd->t()]; 918 const SkPoint& cP1 = pts[fStart->t() < fEnd->t()];
917 SkDLine lineHalf; 919 SkDLine lineHalf;
918 lineHalf[0].set(fStart->pt()); 920 lineHalf[0].set(fStart->pt());
919 lineHalf[1].set(cP1); 921 lineHalf[1].set(cP1);
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
1050 return true; 1052 return true;
1051 } 1053 }
1052 SkASSERT(s0dt0 != 0); 1054 SkASSERT(s0dt0 != 0);
1053 double m = s0xt0 / s0dt0; 1055 double m = s0xt0 / s0dt0;
1054 double sDist = sweep[0].length() * m; 1056 double sDist = sweep[0].length() * m;
1055 double tDist = tweep[0].length() * m; 1057 double tDist = tweep[0].length() * m;
1056 bool useS = fabs(sDist) < fabs(tDist); 1058 bool useS = fabs(sDist) < fabs(tDist);
1057 double mFactor = fabs(useS ? this->distEndRatio(sDist) : rh->distEndRatio(tD ist)); 1059 double mFactor = fabs(useS ? this->distEndRatio(sDist) : rh->distEndRatio(tD ist));
1058 return mFactor < 50; // empirically found limit 1060 return mFactor < 50; // empirically found limit
1059 } 1061 }
OLDNEW
« no previous file with comments | « src/pathops/SkOpAngle.h ('k') | src/pathops/SkOpCoincidence.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698