Index: src/effects/SkPerlinNoiseShader.cpp |
diff --git a/src/effects/SkPerlinNoiseShader.cpp b/src/effects/SkPerlinNoiseShader.cpp |
index 5f858303c5772c9d8096cd32d1132260682faed6..77ce9cb3482346a5ebc719afdad8954146ccbfc1 100644 |
--- a/src/effects/SkPerlinNoiseShader.cpp |
+++ b/src/effects/SkPerlinNoiseShader.cpp |
@@ -124,8 +124,9 @@ public: |
{ |
static const SkScalar gInvBlockSizef = SkScalarInvert(SkIntToScalar(kBlockSize)); |
+ // According to the SVG spec, we must truncate (not round) the seed value. |
+ fSeed = SkScalarTruncToInt(seed); |
// The seed value clamp to the range [1, kRandMaximum - 1]. |
- fSeed = SkScalarRoundToInt(seed); |
if (fSeed <= 0) { |
fSeed = -(fSeed % (kRandMaximum - 1)) + 1; |
} |