OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |