diff options
author | skia.committer@gmail.com <skia.committer@gmail.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-04-06 07:01:10 +0000 |
---|---|---|
committer | skia.committer@gmail.com <skia.committer@gmail.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-04-06 07:01:10 +0000 |
commit | cff0243b0ff1de25b3d99e2bf15a30c0e0a31261 (patch) | |
tree | c852ca7ad4bf74d44fc7660ebc1fdef844a62ad7 | |
parent | 7731eada5bfeb14db403cfee5c1439198c39a05b (diff) |
Sanitizing source files in Skia_Periodic_House_Keeping
git-svn-id: http://skia.googlecode.com/svn/trunk@8548 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | gm/perlinnoise.cpp | 2 | ||||
-rw-r--r-- | src/effects/SkPerlinNoiseShader.cpp | 16 |
2 files changed, 9 insertions, 9 deletions
diff --git a/gm/perlinnoise.cpp b/gm/perlinnoise.cpp index f572371233..2b5539916e 100644 --- a/gm/perlinnoise.cpp +++ b/gm/perlinnoise.cpp @@ -53,7 +53,7 @@ protected: virtual void onDraw(SkCanvas* canvas) { canvas->clear(0x00000000); - + test(canvas, 0, 0, SkPerlinNoiseShader::kFractalNoise_Type, 0.1f, 0.1f, 2, 0, false); test(canvas, 100, 0, SkPerlinNoiseShader::kFractalNoise_Type, diff --git a/src/effects/SkPerlinNoiseShader.cpp b/src/effects/SkPerlinNoiseShader.cpp index 8a7708bbda..9d9290d558 100644 --- a/src/effects/SkPerlinNoiseShader.cpp +++ b/src/effects/SkPerlinNoiseShader.cpp @@ -172,7 +172,7 @@ public: fGradient[channel][i] = SkPoint::Make( SkScalarMul(SkIntToScalar(fNoise[channel][i][0] - kBlockSize), gInvBlockSizef), - SkScalarMul(SkIntToScalar(fNoise[channel][i][1] - kBlockSize), + SkScalarMul(SkIntToScalar(fNoise[channel][i][1] - kBlockSize), gInvBlockSizef)); fGradient[channel][i].normalize(); // Put the normalized gradient back into the noise data @@ -202,7 +202,7 @@ public: SkScalar highFrequencx = SkScalarDiv( SkScalarMulCeil(tileWidth, fBaseFrequency.fX), tileWidth); // BaseFrequency should be non-negative according to the standard. - if (SkScalarDiv(fBaseFrequency.fX, lowFrequencx) < + if (SkScalarDiv(fBaseFrequency.fX, lowFrequencx) < SkScalarDiv(highFrequencx, fBaseFrequency.fX)) { fBaseFrequency.fX = lowFrequencx; } else { @@ -214,7 +214,7 @@ public: SkScalarMulFloor(tileHeight, fBaseFrequency.fY), tileHeight); SkScalar highFrequency = SkScalarDiv( SkScalarMulCeil(tileHeight, fBaseFrequency.fY), tileHeight); - if (SkScalarDiv(fBaseFrequency.fY, lowFrequency) < + if (SkScalarDiv(fBaseFrequency.fY, lowFrequency) < SkScalarDiv(highFrequency, fBaseFrequency.fY)) { fBaseFrequency.fY = lowFrequency; } else { @@ -375,10 +375,10 @@ SkScalar SkPerlinNoiseShader::noise2D(int channel, const PaintingData& paintingD noiseX.noisePositionIntegerValue &= kBlockMask; noiseY.noisePositionIntegerValue &= kBlockMask; int latticeIndex = - paintingData.fLatticeSelector[noiseX.noisePositionIntegerValue] + + paintingData.fLatticeSelector[noiseX.noisePositionIntegerValue] + noiseY.noisePositionIntegerValue; int nextLatticeIndex = - paintingData.fLatticeSelector[(noiseX.noisePositionIntegerValue + 1) & kBlockMask] + + paintingData.fLatticeSelector[(noiseX.noisePositionIntegerValue + 1) & kBlockMask] + noiseY.noisePositionIntegerValue; SkScalar sx = smoothCurve(noiseX.noisePositionFractionValue); SkScalar sy = smoothCurve(noiseY.noisePositionFractionValue); @@ -705,7 +705,7 @@ void GrGLPerlinNoise::emitCode(GrGLShaderBuilder* builder, // Set up TurbulenceInitial stitch values. builder->fsCodeAppendf("\t\tvec4 %s = %s;", stitchData, stitchDataUni); } - + builder->fsCodeAppendf("\t\t%s[channel] = 0.0;", outputColor); builder->fsCodeAppendf("\t\tfloat %s = 1.0;", ratio); @@ -939,10 +939,10 @@ GrEffectRef* SkPerlinNoiseShader::asNewEffect(GrContext* context, const SkPaint& context, *fPaintingData->getNoiseBitmap(), NULL); GrEffectRef* effect = (NULL != permutationsTexture) && (NULL != noiseTexture) ? - GrPerlinNoiseEffect::Create(fType, fPaintingData->fBaseFrequency, + GrPerlinNoiseEffect::Create(fType, fPaintingData->fBaseFrequency, fNumOctaves, fStitchTiles, fPaintingData->fStitchDataInit, - permutationsTexture, noiseTexture, + permutationsTexture, noiseTexture, this->getLocalMatrix(), paint.getAlpha()) : NULL; |