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

Side by Side Diff: experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.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
« no previous file with comments | « no previous file | gm/dcshader.cpp » ('j') | include/core/SkWriteBuffer.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "SkDither.h" 8 #include "SkDither.h"
9 #include "SkPerlinNoiseShader2.h" 9 #include "SkPerlinNoiseShader2.h"
10 #include "SkColorFilter.h" 10 #include "SkColorFilter.h"
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 case kTurbulence_Type: 368 case kTurbulence_Type:
369 return SkPerlinNoiseShader2::MakeTubulence(freqX, freqY, octaves, se ed, &tileSize); 369 return SkPerlinNoiseShader2::MakeTubulence(freqX, freqY, octaves, se ed, &tileSize);
370 case kImprovedNoise_Type: 370 case kImprovedNoise_Type:
371 return SkPerlinNoiseShader2::MakeImprovedNoise(freqX, freqY, octaves , seed); 371 return SkPerlinNoiseShader2::MakeImprovedNoise(freqX, freqY, octaves , seed);
372 default: 372 default:
373 return nullptr; 373 return nullptr;
374 } 374 }
375 } 375 }
376 376
377 void SkPerlinNoiseShader2::flatten(SkWriteBuffer& buffer) const { 377 void SkPerlinNoiseShader2::flatten(SkWriteBuffer& buffer) const {
378 buffer.writeInt((int) fType); 378 buffer.writeInt("fType", (int) fType);
379 buffer.writeScalar(fBaseFrequencyX); 379 buffer.writeScalar("fBaseFrequencyX", fBaseFrequencyX);
380 buffer.writeScalar(fBaseFrequencyY); 380 buffer.writeScalar("fBaseFrequencyY", fBaseFrequencyY);
381 buffer.writeInt(fNumOctaves); 381 buffer.writeInt("fNumOctaves", fNumOctaves);
382 buffer.writeScalar(fSeed); 382 buffer.writeScalar("fSeed", fSeed);
383 buffer.writeInt(fTileSize.fWidth); 383 buffer.writeInt("tileWidth", fTileSize.fWidth);
384 buffer.writeInt(fTileSize.fHeight); 384 buffer.writeInt("tileHeight", fTileSize.fHeight);
385 } 385 }
386 386
387 SkScalar SkPerlinNoiseShader2::PerlinNoiseShaderContext::noise2D( 387 SkScalar SkPerlinNoiseShader2::PerlinNoiseShaderContext::noise2D(
388 int channel, const StitchData& stitchData, const SkPoint& noiseVector) c onst { 388 int channel, const StitchData& stitchData, const SkPoint& noiseVector) c onst {
389 struct Noise { 389 struct Noise {
390 int noisePositionIntegerValue; 390 int noisePositionIntegerValue;
391 int nextNoisePositionIntegerValue; 391 int nextNoisePositionIntegerValue;
392 SkScalar noisePositionFractionValue; 392 SkScalar noisePositionFractionValue;
393 Noise(SkScalar component) 393 Noise(SkScalar component)
394 { 394 {
(...skipping 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after
1396 str->append(" seed: "); 1396 str->append(" seed: ");
1397 str->appendScalar(fSeed); 1397 str->appendScalar(fSeed);
1398 str->append(" stitch tiles: "); 1398 str->append(" stitch tiles: ");
1399 str->append(fStitchTiles ? "true " : "false "); 1399 str->append(fStitchTiles ? "true " : "false ");
1400 1400
1401 this->INHERITED::toString(str); 1401 this->INHERITED::toString(str);
1402 1402
1403 str->append(")"); 1403 str->append(")");
1404 } 1404 }
1405 #endif 1405 #endif
OLDNEW
« no previous file with comments | « no previous file | gm/dcshader.cpp » ('j') | include/core/SkWriteBuffer.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698