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 /tests | |
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 'tests')
-rw-r--r-- | tests/GLProgramsTest.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp index 0df29aafbf..d85d8a5f95 100644 --- a/tests/GLProgramsTest.cpp +++ b/tests/GLProgramsTest.cpp @@ -54,12 +54,6 @@ void GrGLProgramDesc::setRandom(SkMWCRandom* random, fDiscardIfZeroCoverage = random->nextBool(); - if (gpu->caps()->dualSourceBlendingSupport()) { - fDualSrcOutput = random->nextULessThan(kDualSrcOutputCnt); - } else { - fDualSrcOutput = kNone_DualSrcOutput; - } - bool useLocalCoords = random->nextBool() && currAttribIndex < GrDrawState::kMaxVertexAttribCnt; fLocalCoordAttributeIndex = useLocalCoords ? currAttribIndex++ : -1; @@ -78,6 +72,17 @@ void GrGLProgramDesc::setRandom(SkMWCRandom* random, if (dstRead) { this->fDstRead = GrGLShaderBuilder::KeyForDstRead(dstTexture, gpu->glCaps()); } + + CoverageOutput coverageOutput; + bool illegalCoverageOutput; + do { + coverageOutput = static_cast<CoverageOutput>(random->nextULessThan(kCoverageOutputCnt)); + illegalCoverageOutput = (!gpu->caps()->dualSourceBlendingSupport() && + CoverageOutputUsesSecondaryOutput(coverageOutput)) || + !dstRead && kCombineWithDst_CoverageOutput == coverageOutput; + } while (illegalCoverageOutput); + + fCoverageOutput = coverageOutput; } bool GrGpuGL::programUnitTest(int maxStages) { |