diff options
author | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-04-19 13:14:45 +0000 |
---|---|---|
committer | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-04-19 13:14:45 +0000 |
commit | 5920ac276877b36624e07baf97c7768e80a07f98 (patch) | |
tree | 28adb3da6aa138be9eee7f01f2fe218ea11e05e3 /src/gpu/gl/GrGLProgramDesc.cpp | |
parent | 87f99cb543dbba608136bbd2a7b1e6b3356fd6f9 (diff) |
Perform coverage blend with the dst in the shader when using a dst-reading xfermode.
Review URL: https://codereview.chromium.org/14233006
git-svn-id: http://skia.googlecode.com/svn/trunk@8762 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/gl/GrGLProgramDesc.cpp')
-rw-r--r-- | src/gpu/gl/GrGLProgramDesc.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/gpu/gl/GrGLProgramDesc.cpp b/src/gpu/gl/GrGLProgramDesc.cpp index 73846b8df3..86771794d9 100644 --- a/src/gpu/gl/GrGLProgramDesc.cpp +++ b/src/gpu/gl/GrGLProgramDesc.cpp @@ -103,7 +103,7 @@ void GrGLProgramDesc::Build(const GrDrawState& drawState, desc->fDstRead = 0; } - desc->fDualSrcOutput = kNone_DualSrcOutput; + desc->fCoverageOutput = kModulate_CoverageOutput; // Currently the experimental GS will only work with triangle prims (and it doesn't do anything // other than pass through values from the VS to the FS anyway). @@ -151,17 +151,22 @@ void GrGLProgramDesc::Build(const GrDrawState& drawState, GrDrawState::kCoverageAsAlpha_BlendOptFlag))) { if (kZero_GrBlendCoeff == dstCoeff) { // write the coverage value to second color - desc->fDualSrcOutput = kCoverage_DualSrcOutput; + desc->fCoverageOutput = kSecondaryCoverage_CoverageOutput; desc->fFirstCoverageStage = firstCoverageStage; } else if (kSA_GrBlendCoeff == dstCoeff) { // SA dst coeff becomes 1-(1-SA)*coverage when dst is partially covered. - desc->fDualSrcOutput = kCoverageISA_DualSrcOutput; + desc->fCoverageOutput = kSecondaryCoverageISA_CoverageOutput; desc->fFirstCoverageStage = firstCoverageStage; } else if (kSC_GrBlendCoeff == dstCoeff) { // SA dst coeff becomes 1-(1-SA)*coverage when dst is partially covered. - desc->fDualSrcOutput = kCoverageISC_DualSrcOutput; + desc->fCoverageOutput = kSecondaryCoverageISC_CoverageOutput; desc->fFirstCoverageStage = firstCoverageStage; } + } else if (readsDst && + kOne_GrBlendCoeff == drawState.getSrcBlendCoeff() && + kZero_GrBlendCoeff == drawState.getDstBlendCoeff()) { + desc->fCoverageOutput = kCombineWithDst_CoverageOutput; + desc->fFirstCoverageStage = firstCoverageStage; } } |