aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLXferProcessor.cpp
diff options
context:
space:
mode:
authorGravatar cdalton <cdalton@nvidia.com>2015-06-08 15:11:04 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-06-08 15:11:04 -0700
commit86ae0a9e465f157eaa263ef7515e10619946ff83 (patch)
tree6dded95e6c4cb77e649a3402183f114e7f08c37d /src/gpu/gl/GrGLXferProcessor.cpp
parentd6e9fc7f1f7affe1314fc0fbc3d357732c38ca11 (diff)
Add mixed samples support to XPs
Diffstat (limited to 'src/gpu/gl/GrGLXferProcessor.cpp')
-rw-r--r--src/gpu/gl/GrGLXferProcessor.cpp9
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);