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

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

Issue 1911963008: DNC - JSON of flattenables, with field names. Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add names to call sites 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
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
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 #include "SkPerlinNoiseShader.h" 8 #include "SkPerlinNoiseShader.h"
9 #include "SkColorFilter.h" 9 #include "SkColorFilter.h"
10 #include "SkReadBuffer.h" 10 #include "SkReadBuffer.h"
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 &tileSize); 302 &tileSize);
303 case kTurbulence_Type: 303 case kTurbulence_Type:
304 return SkPerlinNoiseShader::MakeTurbulence(freqX, freqY, octaves, se ed, 304 return SkPerlinNoiseShader::MakeTurbulence(freqX, freqY, octaves, se ed,
305 &tileSize); 305 &tileSize);
306 default: 306 default:
307 return nullptr; 307 return nullptr;
308 } 308 }
309 } 309 }
310 310
311 void SkPerlinNoiseShader::flatten(SkWriteBuffer& buffer) const { 311 void SkPerlinNoiseShader::flatten(SkWriteBuffer& buffer) const {
312 buffer.writeInt((int) fType); 312 buffer.writeInt("fType", (int) fType);
313 buffer.writeScalar(fBaseFrequencyX); 313 buffer.writeScalar("fBaseFrequencyX", fBaseFrequencyX);
314 buffer.writeScalar(fBaseFrequencyY); 314 buffer.writeScalar("fBaseFrequencyY", fBaseFrequencyY);
315 buffer.writeInt(fNumOctaves); 315 buffer.writeInt("fNumOctaves", fNumOctaves);
316 buffer.writeScalar(fSeed); 316 buffer.writeScalar("fSeed", fSeed);
317 buffer.writeInt(fTileSize.fWidth); 317 buffer.writeInt("tileWidth", fTileSize.fWidth);
318 buffer.writeInt(fTileSize.fHeight); 318 buffer.writeInt("tileHeight", fTileSize.fHeight);
319 } 319 }
320 320
321 SkScalar SkPerlinNoiseShader::PerlinNoiseShaderContext::noise2D( 321 SkScalar SkPerlinNoiseShader::PerlinNoiseShaderContext::noise2D(
322 int channel, const StitchData& stitchData, const SkPoint& noiseVector) c onst { 322 int channel, const StitchData& stitchData, const SkPoint& noiseVector) c onst {
323 struct Noise { 323 struct Noise {
324 int noisePositionIntegerValue; 324 int noisePositionIntegerValue;
325 int nextNoisePositionIntegerValue; 325 int nextNoisePositionIntegerValue;
326 SkScalar noisePositionFractionValue; 326 SkScalar noisePositionFractionValue;
327 Noise(SkScalar component) 327 Noise(SkScalar component)
328 { 328 {
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after
975 str->append(" seed: "); 975 str->append(" seed: ");
976 str->appendScalar(fSeed); 976 str->appendScalar(fSeed);
977 str->append(" stitch tiles: "); 977 str->append(" stitch tiles: ");
978 str->append(fStitchTiles ? "true " : "false "); 978 str->append(fStitchTiles ? "true " : "false ");
979 979
980 this->INHERITED::toString(str); 980 this->INHERITED::toString(str);
981 981
982 str->append(")"); 982 str->append(")");
983 } 983 }
984 #endif 984 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698