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 | 8 |
9 #include "SkPathMeasure.h" | 9 #include "SkPathMeasure.h" |
10 #include "SkPathMeasurePriv.h" | 10 #include "SkPathMeasurePriv.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 } | 78 } |
79 break; | 79 break; |
80 case kConic_SegType: { | 80 case kConic_SegType: { |
81 SkConic conic(pts[0], pts[2], pts[3], pts[1].fX); | 81 SkConic conic(pts[0], pts[2], pts[3], pts[1].fX); |
82 | 82 |
83 if (0 == startT) { | 83 if (0 == startT) { |
84 if (SK_Scalar1 == stopT) { | 84 if (SK_Scalar1 == stopT) { |
85 dst->conicTo(conic.fPts[1], conic.fPts[2], conic.fW); | 85 dst->conicTo(conic.fPts[1], conic.fPts[2], conic.fW); |
86 } else { | 86 } else { |
87 SkConic tmp[2]; | 87 SkConic tmp[2]; |
88 conic.chopAt(stopT, tmp); | 88 if (conic.chopAt(stopT, tmp)) { |
89 dst->conicTo(tmp[0].fPts[1], tmp[0].fPts[2], tmp[0].fW); | 89 dst->conicTo(tmp[0].fPts[1], tmp[0].fPts[2], tmp[0].fW); |
| 90 } |
90 } | 91 } |
91 } else { | 92 } else { |
92 if (SK_Scalar1 == stopT) { | 93 if (SK_Scalar1 == stopT) { |
93 SkConic tmp1[2]; | 94 SkConic tmp1[2]; |
94 conic.chopAt(startT, tmp1); | 95 if (conic.chopAt(startT, tmp1)) { |
95 dst->conicTo(tmp1[1].fPts[1], tmp1[1].fPts[2], tmp1[1].fW); | 96 dst->conicTo(tmp1[1].fPts[1], tmp1[1].fPts[2], tmp1[1].f
W); |
| 97 } |
96 } else { | 98 } else { |
97 SkConic tmp; | 99 SkConic tmp; |
98 conic.chopAt(startT, stopT, &tmp); | 100 conic.chopAt(startT, stopT, &tmp); |
99 dst->conicTo(tmp.fPts[1], tmp.fPts[2], tmp.fW); | 101 dst->conicTo(tmp.fPts[1], tmp.fPts[2], tmp.fW); |
100 } | 102 } |
101 } | 103 } |
102 } break; | 104 } break; |
103 case kCubic_SegType: | 105 case kCubic_SegType: |
104 if (0 == startT) { | 106 if (0 == startT) { |
105 if (SK_Scalar1 == stopT) { | 107 if (SK_Scalar1 == stopT) { |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 | 699 |
698 for (int i = 0; i < fSegments.count(); i++) { | 700 for (int i = 0; i < fSegments.count(); i++) { |
699 const Segment* seg = &fSegments[i]; | 701 const Segment* seg = &fSegments[i]; |
700 SkDebugf("pathmeas: seg[%d] distance=%g, point=%d, t=%g, type=%d\n", | 702 SkDebugf("pathmeas: seg[%d] distance=%g, point=%d, t=%g, type=%d\n", |
701 i, seg->fDistance, seg->fPtIndex, seg->getScalarT(), | 703 i, seg->fDistance, seg->fPtIndex, seg->getScalarT(), |
702 seg->fType); | 704 seg->fType); |
703 } | 705 } |
704 } | 706 } |
705 | 707 |
706 #endif | 708 #endif |
OLD | NEW |