| 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 | 8 |
| 9 #include "SkDiscretePathEffect.h" | 9 #include "SkDiscretePathEffect.h" |
| 10 #include "SkFixed.h" |
| 11 #include "SkPathMeasure.h" |
| 10 #include "SkReadBuffer.h" | 12 #include "SkReadBuffer.h" |
| 13 #include "SkStrokeRec.h" |
| 11 #include "SkWriteBuffer.h" | 14 #include "SkWriteBuffer.h" |
| 12 #include "SkPathMeasure.h" | |
| 13 #include "SkStrokeRec.h" | |
| 14 | 15 |
| 15 sk_sp<SkPathEffect> SkDiscretePathEffect::Make(SkScalar segLength, SkScalar devi
ation, | 16 sk_sp<SkPathEffect> SkDiscretePathEffect::Make(SkScalar segLength, SkScalar devi
ation, |
| 16 uint32_t seedAssist) { | 17 uint32_t seedAssist) { |
| 17 return sk_sp<SkPathEffect>(new SkDiscretePathEffect(segLength, deviation, se
edAssist)); | 18 return sk_sp<SkPathEffect>(new SkDiscretePathEffect(segLength, deviation, se
edAssist)); |
| 18 } | 19 } |
| 19 | 20 |
| 20 static void Perterb(SkPoint* p, const SkVector& tangent, SkScalar scale) { | 21 static void Perterb(SkPoint* p, const SkVector& tangent, SkScalar scale) { |
| 21 SkVector normal = tangent; | 22 SkVector normal = tangent; |
| 22 normal.rotateCCW(); | 23 normal.rotateCCW(); |
| 23 normal.setLength(scale); | 24 normal.setLength(scale); |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 buffer.writeUInt(fSeedAssist); | 135 buffer.writeUInt(fSeedAssist); |
| 135 } | 136 } |
| 136 | 137 |
| 137 #ifndef SK_IGNORE_TO_STRING | 138 #ifndef SK_IGNORE_TO_STRING |
| 138 void SkDiscretePathEffect::toString(SkString* str) const { | 139 void SkDiscretePathEffect::toString(SkString* str) const { |
| 139 str->appendf("SkDiscretePathEffect: ("); | 140 str->appendf("SkDiscretePathEffect: ("); |
| 140 str->appendf("segLength: %.2f deviation: %.2f seed %d", fSegLength, fPerterb
, fSeedAssist); | 141 str->appendf("segLength: %.2f deviation: %.2f seed %d", fSegLength, fPerterb
, fSeedAssist); |
| 141 str->append(")"); | 142 str->append(")"); |
| 142 } | 143 } |
| 143 #endif | 144 #endif |
| OLD | NEW |