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

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

Issue 1316233002: Style Change: NULL->nullptr (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-27 (Thursday) 10:25:06 EDT Created 5 years, 3 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/doc/SkDocument_XPS_None.cpp ('k') | src/effects/SkAlphaThresholdFilter.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 /* 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"
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 153
154 SkFlattenable* SkPath1DPathEffect::CreateProc(SkReadBuffer& buffer) { 154 SkFlattenable* SkPath1DPathEffect::CreateProc(SkReadBuffer& buffer) {
155 SkScalar advance = buffer.readScalar(); 155 SkScalar advance = buffer.readScalar();
156 if (advance > 0) { 156 if (advance > 0) {
157 SkPath path; 157 SkPath path;
158 buffer.readPath(&path); 158 buffer.readPath(&path);
159 SkScalar phase = buffer.readScalar(); 159 SkScalar phase = buffer.readScalar();
160 Style style = (Style)buffer.readUInt(); 160 Style style = (Style)buffer.readUInt();
161 return SkPath1DPathEffect::Create(path, advance, phase, style); 161 return SkPath1DPathEffect::Create(path, advance, phase, style);
162 } 162 }
163 return NULL; 163 return nullptr;
164 } 164 }
165 165
166 void SkPath1DPathEffect::flatten(SkWriteBuffer& buffer) const { 166 void SkPath1DPathEffect::flatten(SkWriteBuffer& buffer) const {
167 buffer.writeScalar(fAdvance); 167 buffer.writeScalar(fAdvance);
168 if (fAdvance > 0) { 168 if (fAdvance > 0) {
169 buffer.writePath(fPath); 169 buffer.writePath(fPath);
170 buffer.writeScalar(fInitialOffset); 170 buffer.writeScalar(fInitialOffset);
171 buffer.writeUInt(fStyle); 171 buffer.writeUInt(fStyle);
172 } 172 }
173 } 173 }
174 174
175 SkScalar SkPath1DPathEffect::next(SkPath* dst, SkScalar distance, 175 SkScalar SkPath1DPathEffect::next(SkPath* dst, SkScalar distance,
176 SkPathMeasure& meas) const { 176 SkPathMeasure& meas) const {
177 switch (fStyle) { 177 switch (fStyle) {
178 case kTranslate_Style: { 178 case kTranslate_Style: {
179 SkPoint pos; 179 SkPoint pos;
180 if (meas.getPosTan(distance, &pos, NULL)) { 180 if (meas.getPosTan(distance, &pos, nullptr)) {
181 dst->addPath(fPath, pos.fX, pos.fY); 181 dst->addPath(fPath, pos.fX, pos.fY);
182 } 182 }
183 } break; 183 } break;
184 case kRotate_Style: { 184 case kRotate_Style: {
185 SkMatrix matrix; 185 SkMatrix matrix;
186 if (meas.getMatrix(distance, &matrix)) { 186 if (meas.getMatrix(distance, &matrix)) {
187 dst->addPath(fPath, matrix); 187 dst->addPath(fPath, matrix);
188 } 188 }
189 } break; 189 } break;
190 case kMorph_Style: 190 case kMorph_Style:
191 morphpath(dst, fPath, meas, distance); 191 morphpath(dst, fPath, meas, distance);
192 break; 192 break;
193 default: 193 default:
194 SkDEBUGFAIL("unknown Style enum"); 194 SkDEBUGFAIL("unknown Style enum");
195 break; 195 break;
196 } 196 }
197 return fAdvance; 197 return fAdvance;
198 } 198 }
199 199
200 200
201 #ifndef SK_IGNORE_TO_STRING 201 #ifndef SK_IGNORE_TO_STRING
202 void SkPath1DPathEffect::toString(SkString* str) const { 202 void SkPath1DPathEffect::toString(SkString* str) const {
203 str->appendf("SkPath1DPathEffect: ("); 203 str->appendf("SkPath1DPathEffect: (");
204 // TODO: add path and style 204 // TODO: add path and style
205 str->appendf("advance: %.2f phase %.2f", fAdvance, fInitialOffset); 205 str->appendf("advance: %.2f phase %.2f", fAdvance, fInitialOffset);
206 str->appendf(")"); 206 str->appendf(")");
207 } 207 }
208 #endif 208 #endif
OLDNEW
« no previous file with comments | « src/doc/SkDocument_XPS_None.cpp ('k') | src/effects/SkAlphaThresholdFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698