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

Unified Diff: src/gpu/effects/GrOvalEffect.cpp

Issue 231093002: Do div-by-zero check for all gpus in ellipse/rr effects. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 8 months 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/gpu/GrOvalRenderer.cpp ('k') | src/gpu/effects/GrRRectEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrOvalEffect.cpp
diff --git a/src/gpu/effects/GrOvalEffect.cpp b/src/gpu/effects/GrOvalEffect.cpp
index e033a896d8c8242c2b4874119adeef59faac52e1..97b977f7542b8a357e8700d2c406fa0cf37751e8 100644
--- a/src/gpu/effects/GrOvalEffect.cpp
+++ b/src/gpu/effects/GrOvalEffect.cpp
@@ -317,9 +317,8 @@ void GLEllipseEffect::emitCode(GrGLShaderBuilder* builder,
builder->fsCodeAppend("\t\tfloat implicit = dot(Z, d) - 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");
switch (ee.getEdgeType()) {
« no previous file with comments | « src/gpu/GrOvalRenderer.cpp ('k') | src/gpu/effects/GrRRectEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698