| 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 |
| 11 #include "SkPath.h" | 11 #include "SkPath.h" |
| 12 #include "SkTDArray.h" | 12 #include "SkTDArray.h" |
| 13 | 13 |
| 14 struct SkConic; |
| 15 |
| 14 class SK_API SkPathMeasure : SkNoncopyable { | 16 class SK_API SkPathMeasure : SkNoncopyable { |
| 15 public: | 17 public: |
| 16 SkPathMeasure(); | 18 SkPathMeasure(); |
| 17 /** Initialize the pathmeasure with the specified path. The path must remain
valid | 19 /** Initialize the pathmeasure with the specified path. The path must remain
valid |
| 18 for the lifetime of the measure object, or until setPath() is called wit
h | 20 for the lifetime of the measure object, or until setPath() is called wit
h |
| 19 a different path (or null), since the measure object keeps a pointer to
the | 21 a different path (or null), since the measure object keeps a pointer to
the |
| 20 path object (does not copy its data). | 22 path object (does not copy its data). |
| 21 */ | 23 */ |
| 22 SkPathMeasure(const SkPath& path, bool forceClosed); | 24 SkPathMeasure(const SkPath& path, bool forceClosed); |
| 23 ~SkPathMeasure(); | 25 ~SkPathMeasure(); |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 SkScalar getScalarT() const; | 96 SkScalar getScalarT() const; |
| 95 }; | 97 }; |
| 96 SkTDArray<Segment> fSegments; | 98 SkTDArray<Segment> fSegments; |
| 97 SkTDArray<SkPoint> fPts; // Points used to define the segments | 99 SkTDArray<SkPoint> fPts; // Points used to define the segments |
| 98 | 100 |
| 99 static const Segment* NextSegment(const Segment*); | 101 static const Segment* NextSegment(const Segment*); |
| 100 | 102 |
| 101 void buildSegments(); | 103 void buildSegments(); |
| 102 SkScalar compute_quad_segs(const SkPoint pts[3], SkScalar distance, | 104 SkScalar compute_quad_segs(const SkPoint pts[3], SkScalar distance, |
| 103 int mint, int maxt, int ptIndex); | 105 int mint, int maxt, int ptIndex); |
| 106 SkScalar compute_conic_segs(const SkConic&, SkScalar distance, int mint, int
maxt, int ptIndex); |
| 104 SkScalar compute_cubic_segs(const SkPoint pts[3], SkScalar distance, | 107 SkScalar compute_cubic_segs(const SkPoint pts[3], SkScalar distance, |
| 105 int mint, int maxt, int ptIndex); | 108 int mint, int maxt, int ptIndex); |
| 106 const Segment* distanceToSegment(SkScalar distance, SkScalar* t); | 109 const Segment* distanceToSegment(SkScalar distance, SkScalar* t); |
| 107 }; | 110 }; |
| 108 | 111 |
| 109 #endif | 112 #endif |
| OLD | NEW |