OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #include "Sk1DPathEffect.h" | 10 #include "Sk1DPathEffect.h" |
11 #include "SkReadBuffer.h" | 11 #include "SkReadBuffer.h" |
12 #include "SkWriteBuffer.h" | 12 #include "SkWriteBuffer.h" |
13 #include "SkPathMeasure.h" | 13 #include "SkPathMeasure.h" |
| 14 #include "SkStrokeRec.h" |
14 | 15 |
15 bool Sk1DPathEffect::filterPath(SkPath* dst, const SkPath& src, | 16 bool Sk1DPathEffect::filterPath(SkPath* dst, const SkPath& src, |
16 SkStrokeRec*, const SkRect*) const { | 17 SkStrokeRec*, const SkRect*) const { |
17 SkPathMeasure meas(src, false); | 18 SkPathMeasure meas(src, false); |
18 do { | 19 do { |
19 SkScalar length = meas.getLength(); | 20 SkScalar length = meas.getLength(); |
20 SkScalar distance = this->begin(length); | 21 SkScalar distance = this->begin(length); |
21 while (distance < length) { | 22 while (distance < length) { |
22 SkScalar delta = this->next(dst, distance, meas); | 23 SkScalar delta = this->next(dst, distance, meas); |
23 if (delta <= 0) { | 24 if (delta <= 0) { |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 | 200 |
200 | 201 |
201 #ifndef SK_IGNORE_TO_STRING | 202 #ifndef SK_IGNORE_TO_STRING |
202 void SkPath1DPathEffect::toString(SkString* str) const { | 203 void SkPath1DPathEffect::toString(SkString* str) const { |
203 str->appendf("SkPath1DPathEffect: ("); | 204 str->appendf("SkPath1DPathEffect: ("); |
204 // TODO: add path and style | 205 // TODO: add path and style |
205 str->appendf("advance: %.2f phase %.2f", fAdvance, fInitialOffset); | 206 str->appendf("advance: %.2f phase %.2f", fAdvance, fInitialOffset); |
206 str->appendf(")"); | 207 str->appendf(")"); |
207 } | 208 } |
208 #endif | 209 #endif |
OLD | NEW |