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

Unified Diff: src/effects/SkGaussianEdgeShader.cpp

Issue 2319003003: Update SampleAndroidShadows to use algorithm closer to Android OpenGL (Closed)
Patch Set: Created 4 years, 3 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
« samplecode/SampleAndroidShadows.cpp ('K') | « samplecode/SampleAndroidShadows.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkGaussianEdgeShader.cpp
diff --git a/src/effects/SkGaussianEdgeShader.cpp b/src/effects/SkGaussianEdgeShader.cpp
index d73bfadbd77bead16a7c33f836186fd313a2bde1..19f92c84f53b1991da8f7281f43653cc8f86df3f 100644
--- a/src/effects/SkGaussianEdgeShader.cpp
+++ b/src/effects/SkGaussianEdgeShader.cpp
@@ -71,13 +71,13 @@ public:
GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder;
fragBuilder->codeAppendf("vec4 color = %s;", args.fInputColor);
- fragBuilder->codeAppend("float radius = color.g*64.0;");
+ fragBuilder->codeAppend("float radius = color.r*1024.0 + color.g*64.0;");
fragBuilder->codeAppend("float pad = color.b*64.0;");
fragBuilder->codeAppendf("float factor = 1.0 - clamp((%s.z - pad)/radius, 0.0, 1.0);",
fragBuilder->distanceVectorName());
fragBuilder->codeAppend("factor = exp(-factor * factor * 4.0) - 0.018;");
- fragBuilder->codeAppendf("%s = factor*vec4(0.0, 0.0, 0.0, color.r);", args.fOutputColor);
+ fragBuilder->codeAppendf("%s = factor*vec4(0.0, 0.0, 0.0, color.a);", args.fOutputColor);
}
static void GenKey(const GrProcessor& proc, const GrGLSLCaps&,
« samplecode/SampleAndroidShadows.cpp ('K') | « samplecode/SampleAndroidShadows.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698