diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-12-18 15:49:32 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-12-18 15:49:32 +0000 |
commit | 8015cdd8fa5694e52b70e728bcdc6b35d739b819 (patch) | |
tree | 1e698fc094a2228a438e4a8e6c0ae21964c7aef5 /src/effects | |
parent | 83aaf88b999306b2361ee01b0c6a7c345f2242a2 (diff) |
replace SkScalarMulRound(a,b) with SkScalarRountToInt(a*b)
BUG=
R=sugoi@google.com
Review URL: https://codereview.chromium.org/111393010
git-svn-id: http://skia.googlecode.com/svn/trunk@12740 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/effects')
-rw-r--r-- | src/effects/SkPerlinNoiseShader.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/effects/SkPerlinNoiseShader.cpp b/src/effects/SkPerlinNoiseShader.cpp index 26771c5db7..5f858303c5 100644 --- a/src/effects/SkPerlinNoiseShader.cpp +++ b/src/effects/SkPerlinNoiseShader.cpp @@ -203,10 +203,10 @@ public: // When stitching tiled turbulence, the frequencies must be adjusted // so that the tile borders will be continuous. if (fBaseFrequency.fX) { - SkScalar lowFrequencx = SkScalarDiv( - SkScalarMulFloor(tileWidth, fBaseFrequency.fX), tileWidth); - SkScalar highFrequencx = SkScalarDiv( - SkScalarMulCeil(tileWidth, fBaseFrequency.fX), tileWidth); + SkScalar lowFrequencx = + SkScalarFloorToScalar(tileWidth * fBaseFrequency.fX) / tileWidth; + SkScalar highFrequencx = + SkScalarCeilToScalar(tileWidth * fBaseFrequency.fX) / tileWidth; // BaseFrequency should be non-negative according to the standard. if (SkScalarDiv(fBaseFrequency.fX, lowFrequencx) < SkScalarDiv(highFrequencx, fBaseFrequency.fX)) { @@ -216,10 +216,10 @@ public: } } if (fBaseFrequency.fY) { - SkScalar lowFrequency = SkScalarDiv( - SkScalarMulFloor(tileHeight, fBaseFrequency.fY), tileHeight); - SkScalar highFrequency = SkScalarDiv( - SkScalarMulCeil(tileHeight, fBaseFrequency.fY), tileHeight); + SkScalar lowFrequency = + SkScalarFloorToScalar(tileHeight * fBaseFrequency.fY) / tileHeight; + SkScalar highFrequency = + SkScalarCeilToScalar(tileHeight * fBaseFrequency.fY) / tileHeight; if (SkScalarDiv(fBaseFrequency.fY, lowFrequency) < SkScalarDiv(highFrequency, fBaseFrequency.fY)) { fBaseFrequency.fY = lowFrequency; @@ -229,10 +229,10 @@ public: } // Set up TurbulenceInitial stitch values. fStitchDataInit.fWidth = - SkScalarMulRound(tileWidth, fBaseFrequency.fX); + SkScalarRoundToInt(tileWidth * fBaseFrequency.fX); fStitchDataInit.fWrapX = kPerlinNoise + fStitchDataInit.fWidth; fStitchDataInit.fHeight = - SkScalarMulRound(tileHeight, fBaseFrequency.fY); + SkScalarRoundToInt(tileHeight * fBaseFrequency.fY); fStitchDataInit.fWrapY = kPerlinNoise + fStitchDataInit.fHeight; } |