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

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

Issue 1339213004: On gpu, use max(r,g,b) for coverage alpha in LCD and update lcd blend gm. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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
« gm/lcdblendmodes.cpp ('K') | « src/gpu/effects/GrBitmapTextGeoProc.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrDistanceFieldGeoProc.cpp
diff --git a/src/gpu/effects/GrDistanceFieldGeoProc.cpp b/src/gpu/effects/GrDistanceFieldGeoProc.cpp
index 08fa5ac6d55eebfd0b288716e23f991c367121bb..4f8da160e7a11e907180b0e6b592c9e4e5c3d1e0 100644
--- a/src/gpu/effects/GrDistanceFieldGeoProc.cpp
+++ b/src/gpu/effects/GrDistanceFieldGeoProc.cpp
@@ -633,8 +633,10 @@ public:
fsBuilder->codeAppend(
"vec4 val = vec4(smoothstep(vec3(-afwidth), vec3(afwidth), distance), 1.0);");
+ // set alpha to be max of rgb coverage
+ fsBuilder->codeAppend("val.a = max(max(val.r, val.g), val.b);");
- fsBuilder->codeAppendf("%s = vec4(val);", args.fOutputCoverage);
+ fsBuilder->codeAppendf("%s = val;", args.fOutputCoverage);
}
void setData(const GrGLProgramDataManager& pdman,
« gm/lcdblendmodes.cpp ('K') | « src/gpu/effects/GrBitmapTextGeoProc.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698