diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-06-27 18:38:27 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-06-27 18:38:27 +0000 |
commit | 21031e9ee8bf0a4e996030e42a0efbcc555d5f71 (patch) | |
tree | b0a86e9c6d49646be12ae05cbe60268984e7a0eb /src/effects | |
parent | 3e7b280b720ae202db6561f31d862990a7be32d9 (diff) |
fix div-by-zero (triggers debugging assert when scalar=fixed) and add master
(raster only) images for degenerate gradient test
git-svn-id: http://skia.googlecode.com/svn/trunk@1729 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/effects')
-rw-r--r-- | src/effects/SkGradientShader.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/effects/SkGradientShader.cpp b/src/effects/SkGradientShader.cpp index 89b9d34402..d8ffe5afc6 100644 --- a/src/effects/SkGradientShader.cpp +++ b/src/effects/SkGradientShader.cpp @@ -1816,7 +1816,7 @@ private: fStartRadius = SkScalarMul(fRadius1, inv); fSr2D2 = SkScalarSquare(fStartRadius); fA = SkScalarSquare(fDiff.fX) + SkScalarSquare(fDiff.fY) - SK_Scalar1; - fOneOverTwoA = SkScalarInvert(fA * 2); + fOneOverTwoA = fA ? SkScalarInvert(fA * 2) : 0; fPtsToUnit.setTranslate(-fCenter1.fX, -fCenter1.fY); fPtsToUnit.postScale(inv, inv); |