diff options
author | 2015-12-01 13:54:06 -0800 | |
---|---|---|
committer | 2015-12-01 13:54:06 -0800 | |
commit | f34b293681ea49aaa4aaa70d84515e4a58a112e7 (patch) | |
tree | d7d6a4175405abe7d3fff23fb31974d910bda374 /src/gpu/glsl/GrGLSLXferProcessor.cpp | |
parent | 7bceedc550513b13e0065aca66e55204a2ba3e1f (diff) |
Add in shader blending for CoverageSetOp XP
BUG=skia:
Review URL: https://codereview.chromium.org/1488213002
Diffstat (limited to 'src/gpu/glsl/GrGLSLXferProcessor.cpp')
-rw-r--r-- | src/gpu/glsl/GrGLSLXferProcessor.cpp | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/src/gpu/glsl/GrGLSLXferProcessor.cpp b/src/gpu/glsl/GrGLSLXferProcessor.cpp index 7382660f42..b6af968651 100644 --- a/src/gpu/glsl/GrGLSLXferProcessor.cpp +++ b/src/gpu/glsl/GrGLSLXferProcessor.cpp @@ -63,23 +63,11 @@ void GrGLSLXferProcessor::emitCode(const EmitArgs& args) { this->emitBlendCodeForDstRead(args.fPB, fragBuilder, args.fInputColor, + args.fInputCoverage, dstColor, args.fOutputPrimary, + args.fOutputSecondary, args.fXP); - - // Apply coverage. - if (args.fXP.dstReadUsesMixedSamples()) { - if (args.fInputCoverage) { - fragBuilder->codeAppendf("%s *= %s;", args.fOutputPrimary, args.fInputCoverage); - fragBuilder->codeAppendf("%s = %s;", args.fOutputSecondary, args.fInputCoverage); - } else { - fragBuilder->codeAppendf("%s = vec4(1.0);", args.fOutputSecondary); - } - } else if (args.fInputCoverage) { - fragBuilder->codeAppendf("%s = %s * %s + (vec4(1.0) - %s) * %s;", - args.fOutputPrimary, args.fInputCoverage, - args.fOutputPrimary, args.fInputCoverage, dstColor); - } } void GrGLSLXferProcessor::setData(const GrGLSLProgramDataManager& pdm, const GrXferProcessor& xp) { |