Chromium Code Reviews| Index: tests/GLProgramsTest.cpp |
| diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp |
| index a7482120b4f453d20e3ee117bdfbd01bed1de76b..e6d4ff73da504e2c0db0e2505083a859b5de56d2 100644 |
| --- a/tests/GLProgramsTest.cpp |
| +++ b/tests/GLProgramsTest.cpp |
| @@ -14,6 +14,7 @@ |
| #include "GrBackendEffectFactory.h" |
| #include "GrContextFactory.h" |
| +#include "GrOptDrawState.h" |
| #include "effects/GrConfigConversionEffect.h" |
| #include "gl/GrGLPathRendering.h" |
| #include "gl/GrGpuGL.h" |
| @@ -157,16 +158,25 @@ bool GrGLProgramDesc::setRandom(SkRandom* random, |
| kAttribute_ColorInput == header->fCoverageInput; |
| header->fHasGeometryProcessor = vertexShader; |
| - CoverageOutput coverageOutput; |
| - bool illegalCoverageOutput; |
| - do { |
| - coverageOutput = static_cast<CoverageOutput>(random->nextULessThan(kCoverageOutputCnt)); |
| - illegalCoverageOutput = (!gpu->caps()->dualSourceBlendingSupport() && |
| - CoverageOutputUsesSecondaryOutput(coverageOutput)) || |
| - (!dstRead && kCombineWithDst_CoverageOutput == coverageOutput); |
| - } while (illegalCoverageOutput); |
| + GrOptDrawState::PrimaryOutputType primaryOutput; |
|
bsalomon
2014/09/17 19:47:42
At some point this has to turn into build a random
egdaniel
2014/09/18 15:24:37
Yes I definitely agree. Let's wait till we finaliz
|
| + GrOptDrawState::SecondaryOutputType secondaryOutput; |
| + if (!dstRead) { |
| + primaryOutput = GrOptDrawState::kModulate_PrimaryOutputType; |
| + } else { |
| + primaryOutput = static_cast<GrOptDrawState::PrimaryOutputType>( |
| + random->nextULessThan(GrOptDrawState::kPrimaryOutputTypeCnt)); |
| + } |
| + |
| + if (GrOptDrawState::kCombineWithDst_PrimaryOutputType == primaryOutput || |
| + !gpu->caps()->dualSourceBlendingSupport()) { |
| + secondaryOutput = GrOptDrawState::kNone_SecondaryOutputType; |
| + } else { |
| + secondaryOutput = static_cast<GrOptDrawState::SecondaryOutputType>( |
| + random->nextULessThan(GrOptDrawState::kSecondaryOutputTypeCnt)); |
| + } |
| - header->fCoverageOutput = coverageOutput; |
| + header->fPrimaryOutputType = primaryOutput; |
| + header->fSecondaryOutputType = secondaryOutput; |
| this->finalize(); |
| return true; |