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 "SkDiscretePathEffect.h" | 10 #include "SkDiscretePathEffect.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 static void Perterb(SkPoint* p, const SkVector& tangent, SkScalar scale) { | 16 static void Perterb(SkPoint* p, const SkVector& tangent, SkScalar scale) { |
16 SkVector normal = tangent; | 17 SkVector normal = tangent; |
17 normal.rotateCCW(); | 18 normal.rotateCCW(); |
18 normal.setLength(scale); | 19 normal.setLength(scale); |
19 *p += normal; | 20 *p += normal; |
20 } | 21 } |
21 | 22 |
22 SkDiscretePathEffect::SkDiscretePathEffect(SkScalar segLength, | 23 SkDiscretePathEffect::SkDiscretePathEffect(SkScalar segLength, |
23 SkScalar deviation, | 24 SkScalar deviation, |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 buffer.writeUInt(fSeedAssist); | 130 buffer.writeUInt(fSeedAssist); |
130 } | 131 } |
131 | 132 |
132 #ifndef SK_IGNORE_TO_STRING | 133 #ifndef SK_IGNORE_TO_STRING |
133 void SkDiscretePathEffect::toString(SkString* str) const { | 134 void SkDiscretePathEffect::toString(SkString* str) const { |
134 str->appendf("SkDiscretePathEffect: ("); | 135 str->appendf("SkDiscretePathEffect: ("); |
135 str->appendf("segLength: %.2f deviation: %.2f seed %d", fSegLength, fPerterb
, fSeedAssist); | 136 str->appendf("segLength: %.2f deviation: %.2f seed %d", fSegLength, fPerterb
, fSeedAssist); |
136 str->append(")"); | 137 str->append(")"); |
137 } | 138 } |
138 #endif | 139 #endif |
OLD | NEW |