Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(851)

Side by Side Diff: src/effects/SkDiscretePathEffect.cpp

Issue 1855733002: change flattenable factory to return sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/effects/SkDashPathEffect.cpp ('k') | src/effects/SkDisplacementMapEffect.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « src/effects/SkDashPathEffect.cpp ('k') | src/effects/SkDisplacementMapEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698