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

Unified Diff: src/gpu/effects/GrBitmapTextGeoProc.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
Index: src/gpu/effects/GrBitmapTextGeoProc.cpp
diff --git a/src/gpu/effects/GrBitmapTextGeoProc.cpp b/src/gpu/effects/GrBitmapTextGeoProc.cpp
index e8bcd57e6ddd7739061d7f538af588aa7f760b83..c866ae6ca57a1e6954012ce7c8c324617a2e3c4a 100644
--- a/src/gpu/effects/GrBitmapTextGeoProc.cpp
+++ b/src/gpu/effects/GrBitmapTextGeoProc.cpp
@@ -69,6 +69,12 @@ public:
fsBuilder->codeAppendf("%s = ", args.fOutputCoverage);
fsBuilder->appendTextureLookup(args.fSamplers[0], v.fsIn(), kVec2f_GrSLType);
fsBuilder->codeAppend(";");
+ if (cte.maskFormat() == kA565_GrMaskFormat) {
+ // set alpha to be max of rgb coverage
+ fsBuilder->codeAppendf("%s.a = max(max(%s.r, %s.g), %s.b);",
+ args.fOutputCoverage, args.fOutputCoverage,
+ args.fOutputCoverage, args.fOutputCoverage);
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698