Index: src/gpu/effects/GrCustomXfermode.cpp |
diff --git a/src/gpu/effects/GrCustomXfermode.cpp b/src/gpu/effects/GrCustomXfermode.cpp |
index 459ff52948c361b76a7fbeb8d8886db7f058a4b7..04ff4a746ba733692ddab05ebb012f94ee341afb 100644 |
--- a/src/gpu/effects/GrCustomXfermode.cpp |
+++ b/src/gpu/effects/GrCustomXfermode.cpp |
@@ -172,8 +172,17 @@ |
GrGLSLBlend::AppendMode(fragBuilder, srcColor, dstColor, outColor, xp.mode()); |
// 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 {} |