OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2008 The Android Open Source Project | 2 * Copyright 2008 The Android Open Source Project |
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 | 7 |
8 #include "SkStrokerPriv.h" | 8 #include "SkStrokerPriv.h" |
9 #include "SkGeometry.h" | 9 #include "SkGeometry.h" |
10 #include "SkPath.h" | 10 #include "SkPath.h" |
(...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1032 | 1032 |
1033 bool SkPathStroker::cubicStroke(const SkPoint cubic[4], SkQuadConstruct* quadPts
) { | 1033 bool SkPathStroker::cubicStroke(const SkPoint cubic[4], SkQuadConstruct* quadPts
) { |
1034 if (!fFoundTangents) { | 1034 if (!fFoundTangents) { |
1035 ResultType resultType = this->tangentsMeet(cubic, quadPts); | 1035 ResultType resultType = this->tangentsMeet(cubic, quadPts); |
1036 if (kQuad_ResultType != resultType) { | 1036 if (kQuad_ResultType != resultType) { |
1037 if (kNormalError_ResultType == resultType) { | 1037 if (kNormalError_ResultType == resultType) { |
1038 return false; | 1038 return false; |
1039 } | 1039 } |
1040 if ((kDegenerate_ResultType == resultType | 1040 if ((kDegenerate_ResultType == resultType |
1041 || points_within_dist(quadPts->fQuad[0], quadPts->fQuad[2], | 1041 || points_within_dist(quadPts->fQuad[0], quadPts->fQuad[2], |
1042 fInvResScaleSquared)) && cubicMidOnLine(cubic, quadPts)) { | 1042 fInvResScale)) && cubicMidOnLine(cubic, quadPts)) { |
1043 addDegenerateLine(quadPts); | 1043 addDegenerateLine(quadPts); |
1044 return true; | 1044 return true; |
1045 } | 1045 } |
1046 } else { | 1046 } else { |
1047 fFoundTangents = true; | 1047 fFoundTangents = true; |
1048 } | 1048 } |
1049 } | 1049 } |
1050 if (fFoundTangents) { | 1050 if (fFoundTangents) { |
1051 ResultType resultType = this->compareQuadCubic(cubic, quadPts); | 1051 ResultType resultType = this->compareQuadCubic(cubic, quadPts); |
1052 if (kQuad_ResultType == resultType) { | 1052 if (kQuad_ResultType == resultType) { |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1450 default: | 1450 default: |
1451 break; | 1451 break; |
1452 } | 1452 } |
1453 | 1453 |
1454 if (fWidth < SkMinScalar(rw, rh) && !fDoFill) { | 1454 if (fWidth < SkMinScalar(rw, rh) && !fDoFill) { |
1455 r = rect; | 1455 r = rect; |
1456 r.inset(radius, radius); | 1456 r.inset(radius, radius); |
1457 dst->addRect(r, reverse_direction(dir)); | 1457 dst->addRect(r, reverse_direction(dir)); |
1458 } | 1458 } |
1459 } | 1459 } |
OLD | NEW |