From 21031e9ee8bf0a4e996030e42a0efbcc555d5f71 Mon Sep 17 00:00:00 2001 From: "reed@google.com" Date: Mon, 27 Jun 2011 18:38:27 +0000 Subject: [PATCH] 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 --- src/effects/SkGradientShader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);