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 {} |