OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 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 #ifndef SkPathMeasure_DEFINED | 8 #ifndef SkPathMeasure_DEFINED |
9 #define SkPathMeasure_DEFINED | 9 #define SkPathMeasure_DEFINED |
10 | 10 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 private: | 82 private: |
83 SkPath::Iter fIter; | 83 SkPath::Iter fIter; |
84 const SkPath* fPath; | 84 const SkPath* fPath; |
85 SkScalar fLength; // relative to the current contour | 85 SkScalar fLength; // relative to the current contour |
86 int fFirstPtIndex; // relative to the current contour | 86 int fFirstPtIndex; // relative to the current contour |
87 bool fIsClosed; // relative to the current contour | 87 bool fIsClosed; // relative to the current contour |
88 bool fForceClosed; | 88 bool fForceClosed; |
89 | 89 |
90 struct Segment { | 90 struct Segment { |
91 SkScalar fDistance; // total distance up to this point | 91 SkScalar fDistance; // total distance up to this point |
92 unsigned fPtIndex : 15; // index into the fPts array | 92 unsigned fPtIndex; // index into the fPts array |
| 93 #ifdef SK_SUPPORT_LEGACY_PATH_MEASURE_TVALUE |
93 unsigned fTValue : 15; | 94 unsigned fTValue : 15; |
| 95 #else |
| 96 unsigned fTValue : 30; |
| 97 #endif |
94 unsigned fType : 2; | 98 unsigned fType : 2; |
95 | 99 |
96 SkScalar getScalarT() const; | 100 SkScalar getScalarT() const; |
97 }; | 101 }; |
98 SkTDArray<Segment> fSegments; | 102 SkTDArray<Segment> fSegments; |
99 SkTDArray<SkPoint> fPts; // Points used to define the segments | 103 SkTDArray<SkPoint> fPts; // Points used to define the segments |
100 | 104 |
101 static const Segment* NextSegment(const Segment*); | 105 static const Segment* NextSegment(const Segment*); |
102 | 106 |
103 void buildSegments(); | 107 void buildSegments(); |
104 SkScalar compute_quad_segs(const SkPoint pts[3], SkScalar distance, | 108 SkScalar compute_quad_segs(const SkPoint pts[3], SkScalar distance, |
105 int mint, int maxt, int ptIndex); | 109 int mint, int maxt, int ptIndex); |
106 SkScalar compute_conic_segs(const SkConic&, SkScalar distance, int mint, int
maxt, int ptIndex); | 110 SkScalar compute_conic_segs(const SkConic&, SkScalar distance, int mint, int
maxt, int ptIndex); |
107 SkScalar compute_cubic_segs(const SkPoint pts[3], SkScalar distance, | 111 SkScalar compute_cubic_segs(const SkPoint pts[3], SkScalar distance, |
108 int mint, int maxt, int ptIndex); | 112 int mint, int maxt, int ptIndex); |
109 const Segment* distanceToSegment(SkScalar distance, SkScalar* t); | 113 const Segment* distanceToSegment(SkScalar distance, SkScalar* t); |
110 }; | 114 }; |
111 | 115 |
112 #endif | 116 #endif |
OLD | NEW |