Index: src/gpu/glsl/GrGLSLXferProcessor.cpp |
diff --git a/src/gpu/glsl/GrGLSLXferProcessor.cpp b/src/gpu/glsl/GrGLSLXferProcessor.cpp |
index 81bd015718c8e8ac7aeea99b76998409d8c252b2..e109775aced5e2bf16db58e998f85c20a8351895 100644 |
--- a/src/gpu/glsl/GrGLSLXferProcessor.cpp |
+++ b/src/gpu/glsl/GrGLSLXferProcessor.cpp |
@@ -88,3 +88,21 @@ void GrGLSLXferProcessor::setData(const GrGLSLProgramDataManager& pdm, const GrX |
this->onSetData(pdm, xp); |
} |
+void GrGLSLXferProcessor::DefaultCoverageModulation(GrGLSLXPFragmentBuilder* fragBuilder, |
+ const char* srcCoverage, |
+ const char* dstColor, |
+ const char* outColor, |
+ const char* outColorSecondary, |
+ const GrXferProcessor& proc) { |
+ if (proc.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); |
+ } |
+} |