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 "SkReadBuffer.h" | 10 #include "SkReadBuffer.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 } | 120 } |
121 } | 121 } |
122 if (meas.isClosed()) { | 122 if (meas.isClosed()) { |
123 dst->close(); | 123 dst->close(); |
124 } | 124 } |
125 } | 125 } |
126 } while (meas.nextContour()); | 126 } while (meas.nextContour()); |
127 return true; | 127 return true; |
128 } | 128 } |
129 | 129 |
130 SkFlattenable* SkDiscretePathEffect::CreateProc(SkReadBuffer& buffer) { | 130 sk_sp<SkFlattenable> SkDiscretePathEffect::CreateProc(SkReadBuffer& buffer) { |
131 SkScalar segLength = buffer.readScalar(); | 131 SkScalar segLength = buffer.readScalar(); |
132 SkScalar perterb = buffer.readScalar(); | 132 SkScalar perterb = buffer.readScalar(); |
133 uint32_t seed = buffer.readUInt(); | 133 uint32_t seed = buffer.readUInt(); |
134 return Make(segLength, perterb, seed).release(); | 134 return Make(segLength, perterb, seed); |
135 } | 135 } |
136 | 136 |
137 void SkDiscretePathEffect::flatten(SkWriteBuffer& buffer) const { | 137 void SkDiscretePathEffect::flatten(SkWriteBuffer& buffer) const { |
138 buffer.writeScalar(fSegLength); | 138 buffer.writeScalar(fSegLength); |
139 buffer.writeScalar(fPerterb); | 139 buffer.writeScalar(fPerterb); |
140 buffer.writeUInt(fSeedAssist); | 140 buffer.writeUInt(fSeedAssist); |
141 } | 141 } |
142 | 142 |
143 #ifndef SK_IGNORE_TO_STRING | 143 #ifndef SK_IGNORE_TO_STRING |
144 void SkDiscretePathEffect::toString(SkString* str) const { | 144 void SkDiscretePathEffect::toString(SkString* str) const { |
145 str->appendf("SkDiscretePathEffect: ("); | 145 str->appendf("SkDiscretePathEffect: ("); |
146 str->appendf("segLength: %.2f deviation: %.2f seed %d", fSegLength, fPerterb
, fSeedAssist); | 146 str->appendf("segLength: %.2f deviation: %.2f seed %d", fSegLength, fPerterb
, fSeedAssist); |
147 str->append(")"); | 147 str->append(")"); |
148 } | 148 } |
149 #endif | 149 #endif |
OLD | NEW |