diff options
author | 2015-06-08 15:11:04 -0700 | |
---|---|---|
committer | 2015-06-08 15:11:04 -0700 | |
commit | 86ae0a9e465f157eaa263ef7515e10619946ff83 (patch) | |
tree | 6dded95e6c4cb77e649a3402183f114e7f08c37d /src/gpu/gl/GrGLXferProcessor.cpp | |
parent | d6e9fc7f1f7affe1314fc0fbc3d357732c38ca11 (diff) |
Add mixed samples support to XPs
BUG=skia:
Review URL: https://codereview.chromium.org/1164973002
Diffstat (limited to 'src/gpu/gl/GrGLXferProcessor.cpp')
-rw-r--r-- | src/gpu/gl/GrGLXferProcessor.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gpu/gl/GrGLXferProcessor.cpp b/src/gpu/gl/GrGLXferProcessor.cpp index 3d3ab49dad..e62497193f 100644 --- a/src/gpu/gl/GrGLXferProcessor.cpp +++ b/src/gpu/gl/GrGLXferProcessor.cpp @@ -63,7 +63,14 @@ void GrGLXferProcessor::emitCode(const EmitArgs& args) { args.fXP); // Apply coverage. - if (args.fXP.readsCoverage()) { + if (args.fXP.dstReadUsesMixedSamples()) { + if (args.fXP.readsCoverage()) { + fsBuilder->codeAppendf("%s *= %s;", args.fOutputPrimary, args.fInputCoverage); + fsBuilder->codeAppendf("%s = %s;", args.fOutputSecondary, args.fInputCoverage); + } else { + fsBuilder->codeAppendf("%s = vec4(1.0);", args.fOutputSecondary); + } + } else if (args.fXP.readsCoverage()) { fsBuilder->codeAppendf("%s = %s * %s + (vec4(1.0) - %s) * %s;", args.fOutputPrimary, args.fInputCoverage, args.fOutputPrimary, args.fInputCoverage, dstColor); |