Do div-by-zero check for all gpus in ellipse/rr effects.
R=jvanverth@google.com
Author: bsalomon@google.com
Review URL: https://codereview.chromium.org/231093002
git-svn-id: http://skia.googlecode.com/svn/trunk@14110 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/effects/GrRRectEffect.cpp b/src/gpu/effects/GrRRectEffect.cpp
index c013357..bc79057 100644
--- a/src/gpu/effects/GrRRectEffect.cpp
+++ b/src/gpu/effects/GrRRectEffect.cpp
@@ -572,9 +572,8 @@
builder->fsCodeAppend("\t\tfloat implicit = dot(Z, dxy) - 1.0;\n");
// grad_dot is the squared length of the gradient of the implicit.
builder->fsCodeAppendf("\t\tfloat grad_dot = 4.0 * dot(Z, Z);\n");
- if (builder->ctxInfo().caps()->dropsTileOnZeroDivide()) {
- builder->fsCodeAppend("\t\tgrad_dot = max(grad_dot, 1.0e-4);\n");
- }
+ // avoid calling inversesqrt on zero.
+ builder->fsCodeAppend("\t\tgrad_dot = max(grad_dot, 1.0e-4);\n");
builder->fsCodeAppendf("\t\tfloat approx_dist = implicit * inversesqrt(grad_dot);\n");
if (kFillAA_GrEffectEdgeType == erre.getEdgeType()) {