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

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

Issue 1626443002: Revert of Add gpu implementation of OverdrawXfermode (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 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/effects/GrCustomXfermode.cpp ('k') | src/gpu/glsl/GrGLSLXferProcessor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrPorterDuffXferProcessor.cpp
diff --git a/src/gpu/effects/GrPorterDuffXferProcessor.cpp b/src/gpu/effects/GrPorterDuffXferProcessor.cpp
index c443e1e9925725e49cd6655191544d1cf92b75a3..94d3dd67a93ae8df8da4e06b53d41286eddae558 100644
--- a/src/gpu/effects/GrPorterDuffXferProcessor.cpp
+++ b/src/gpu/effects/GrPorterDuffXferProcessor.cpp
@@ -559,8 +559,17 @@
GrGLSLBlend::AppendMode(fragBuilder, srcColor, dstColor, outColor, xp.getXfermode());
// Apply coverage.
- INHERITED::DefaultCoverageModulation(fragBuilder, srcCoverage, dstColor, outColor,
- outColorSecondary, xp);
+ if (xp.dstReadUsesMixedSamples()) {
+ if (srcCoverage) {
+ fragBuilder->codeAppendf("%s *= %s;", outColor, srcCoverage);
+ fragBuilder->codeAppendf("%s = %s;", outColorSecondary, srcCoverage);
+ } else {
+ fragBuilder->codeAppendf("%s = vec4(1.0);", outColorSecondary);
+ }
+ } else if (srcCoverage) {
+ fragBuilder->codeAppendf("%s = %s * %s + (vec4(1.0) - %s) * %s;",
+ outColor, srcCoverage, outColor, srcCoverage, dstColor);
+ }
}
void onSetData(const GrGLSLProgramDataManager&, const GrXferProcessor&) override {}
« no previous file with comments | « src/gpu/effects/GrCustomXfermode.cpp ('k') | src/gpu/glsl/GrGLSLXferProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698