| 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 SkScalar fTolerance; | 88 SkScalar fTolerance; |
| 89 SkScalar fLength; // relative to the current contour | 89 SkScalar fLength; // relative to the current contour |
| 90 int fFirstPtIndex; // relative to the current contour | 90 int fFirstPtIndex; // relative to the current contour |
| 91 bool fIsClosed; // relative to the current contour | 91 bool fIsClosed; // relative to the current contour |
| 92 bool fForceClosed; | 92 bool fForceClosed; |
| 93 | 93 |
| 94 struct Segment { | 94 struct Segment { |
| 95 SkScalar fDistance; // total distance up to this point | 95 SkScalar fDistance; // total distance up to this point |
| 96 unsigned fPtIndex; // index into the fPts array | 96 unsigned fPtIndex; // index into the fPts array |
| 97 unsigned fTValue : 30; | 97 unsigned fTValue : 30; |
| 98 unsigned fType : 2; | 98 unsigned fType : 2; // actually the enum SkSegType |
| 99 // See SkPathMeasurePriv.h |
| 99 | 100 |
| 100 SkScalar getScalarT() const; | 101 SkScalar getScalarT() const; |
| 101 }; | 102 }; |
| 102 SkTDArray<Segment> fSegments; | 103 SkTDArray<Segment> fSegments; |
| 103 SkTDArray<SkPoint> fPts; // Points used to define the segments | 104 SkTDArray<SkPoint> fPts; // Points used to define the segments |
| 104 | 105 |
| 105 static const Segment* NextSegment(const Segment*); | 106 static const Segment* NextSegment(const Segment*); |
| 106 | 107 |
| 107 void buildSegments(); | 108 void buildSegments(); |
| 108 SkScalar compute_quad_segs(const SkPoint pts[3], SkScalar distance, | 109 SkScalar compute_quad_segs(const SkPoint pts[3], SkScalar distance, |
| 109 int mint, int maxt, int ptIndex); | 110 int mint, int maxt, int ptIndex); |
| 110 SkScalar compute_conic_segs(const SkConic&, SkScalar distance, | 111 SkScalar compute_conic_segs(const SkConic&, SkScalar distance, |
| 111 int mint, const SkPoint& minPt, | 112 int mint, const SkPoint& minPt, |
| 112 int maxt, const SkPoint& maxPt, int ptIndex); | 113 int maxt, const SkPoint& maxPt, int ptIndex); |
| 113 SkScalar compute_cubic_segs(const SkPoint pts[3], SkScalar distance, | 114 SkScalar compute_cubic_segs(const SkPoint pts[3], SkScalar distance, |
| 114 int mint, int maxt, int ptIndex); | 115 int mint, int maxt, int ptIndex); |
| 115 const Segment* distanceToSegment(SkScalar distance, SkScalar* t); | 116 const Segment* distanceToSegment(SkScalar distance, SkScalar* t); |
| 116 bool quad_too_curvy(const SkPoint pts[3]); | 117 bool quad_too_curvy(const SkPoint pts[3]); |
| 117 bool conic_too_curvy(const SkPoint& firstPt, const SkPoint& midTPt,const SkP
oint& lastPt); | 118 bool conic_too_curvy(const SkPoint& firstPt, const SkPoint& midTPt,const SkP
oint& lastPt); |
| 118 bool cheap_dist_exceeds_limit(const SkPoint& pt, SkScalar x, SkScalar y); | 119 bool cheap_dist_exceeds_limit(const SkPoint& pt, SkScalar x, SkScalar y); |
| 119 bool cubic_too_curvy(const SkPoint pts[4]); | 120 bool cubic_too_curvy(const SkPoint pts[4]); |
| 120 }; | 121 }; |
| 121 | 122 |
| 122 #endif | 123 #endif |
| OLD | NEW |