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

Unified Diff: src/effects/SkPerlinNoiseShader.cpp

Issue 85463005: remove SkFloatToScalar macro (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: add flag to expose SkFloatToScalar to chromium Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/effects/SkLightingImageFilter.cpp ('k') | src/gpu/GrAAHairLinePathRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkPerlinNoiseShader.cpp
diff --git a/src/effects/SkPerlinNoiseShader.cpp b/src/effects/SkPerlinNoiseShader.cpp
index f2ce67924e5d4109800cfafc6b490f8868caf950..51675ad2bbe0b89a56e56d318c8a1d612727cd38 100644
--- a/src/effects/SkPerlinNoiseShader.cpp
+++ b/src/effects/SkPerlinNoiseShader.cpp
@@ -45,7 +45,7 @@ inline int checkNoise(int noiseValue, int limitValue, int newValue) {
}
inline SkScalar smoothCurve(SkScalar t) {
- static const SkScalar SK_Scalar3 = SkFloatToScalar(3.0f);
+ static const SkScalar SK_Scalar3 = 3.0f;
// returns t * t * (3 - 2 * t)
return SkScalarMul(SkScalarSquare(t), SK_Scalar3 - 2 * t);
@@ -165,7 +165,7 @@ public:
}
// Half of the largest possible value for 16 bit unsigned int
- static const SkScalar gHalfMax16bits = SkFloatToScalar(32767.5f);
+ static const SkScalar gHalfMax16bits = 32767.5f;
// Compute gradients from permutated noise data
for (int channel = 0; channel < 4; ++channel) {
@@ -729,10 +729,10 @@ GrEffectRef* GrPerlinNoiseEffect::TestCreate(SkRandom* random,
bool stitchTiles = random->nextBool();
SkScalar seed = SkIntToScalar(random->nextU());
SkISize tileSize = SkISize::Make(random->nextRangeU(4, 4096), random->nextRangeU(4, 4096));
- SkScalar baseFrequencyX = random->nextRangeScalar(SkFloatToScalar(0.01f),
- SkFloatToScalar(0.99f));
- SkScalar baseFrequencyY = random->nextRangeScalar(SkFloatToScalar(0.01f),
- SkFloatToScalar(0.99f));
+ SkScalar baseFrequencyX = random->nextRangeScalar(0.01f,
+ 0.99f);
+ SkScalar baseFrequencyY = random->nextRangeScalar(0.01f,
+ 0.99f);
SkShader* shader = random->nextBool() ?
SkPerlinNoiseShader::CreateFractalNoise(baseFrequencyX, baseFrequencyY, numOctaves, seed,
« no previous file with comments | « src/effects/SkLightingImageFilter.cpp ('k') | src/gpu/GrAAHairLinePathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698