Chromium Code Reviews| Index: src/gpu/GrOptDrawState.cpp |
| diff --git a/src/gpu/GrOptDrawState.cpp b/src/gpu/GrOptDrawState.cpp |
| index a9d8ec48881c1fc77c7d8f6b86bd2f1e72e75f65..b1117273b2a64e75b8154cb18d46b76535d674d0 100644 |
| --- a/src/gpu/GrOptDrawState.cpp |
| +++ b/src/gpu/GrOptDrawState.cpp |
| @@ -44,7 +44,6 @@ GrOptDrawState::GrOptDrawState(const GrDrawState& drawState, |
| int firstColorStageIdx = 0; |
| int firstCoverageStageIdx = 0; |
| - bool separateCoverageFromColor; |
| uint8_t fixedFunctionVAToRemove = 0; |
| @@ -58,8 +57,7 @@ GrOptDrawState::GrOptDrawState(const GrDrawState& drawState, |
| this->removeFixedFunctionVertexAttribs(fixedFunctionVAToRemove, &descInfo); |
| } |
| this->getStageStats(drawState, firstColorStageIdx, firstCoverageStageIdx, &descInfo); |
| - this->setOutputStateInfo(drawState, *gpu->caps(), firstCoverageStageIdx, &descInfo, |
| - &separateCoverageFromColor); |
| + this->setOutputStateInfo(drawState, *gpu->caps(), firstCoverageStageIdx, &descInfo); |
| // Copy GeometryProcesssor from DS or ODS |
| if (drawState.hasGeometryProcessor()) { |
| @@ -86,9 +84,6 @@ GrOptDrawState::GrOptDrawState(const GrDrawState& drawState, |
| if (firstCoverageStageIdx < drawState.numCoverageStages()) { |
| fFragmentStages.push_back_n(drawState.numCoverageStages() - firstCoverageStageIdx, |
| &drawState.getCoverageStage(firstCoverageStageIdx)); |
| - if (!separateCoverageFromColor) { |
| - fNumColorStages = fFragmentStages.count(); |
| - } |
| } |
| // now create a key |
| @@ -137,14 +132,12 @@ GrOptDrawState* GrOptDrawState::Create(const GrDrawState& drawState, |
| void GrOptDrawState::setOutputStateInfo(const GrDrawState& ds, |
| const GrDrawTargetCaps& caps, |
| int firstCoverageStageIdx, |
| - GrProgramDesc::DescInfo* descInfo, |
| - bool* separateCoverageFromColor) { |
| + GrProgramDesc::DescInfo* descInfo) { |
| // Set this default and then possibly change our mind if there is coverage. |
| descInfo->fPrimaryOutputType = GrProgramDesc::kModulate_PrimaryOutputType; |
| descInfo->fSecondaryOutputType = GrProgramDesc::kNone_SecondaryOutputType; |
| // If we do have coverage determine whether it matters. |
| - *separateCoverageFromColor = this->hasGeometryProcessor(); |
| if (!this->isCoverageDrawing() && |
|
bsalomon
2014/11/10 18:50:12
Can we make GrOptDrawState have something like:
b
|
| (ds.numCoverageStages() - firstCoverageStageIdx > 0 || |
| ds.hasGeometryProcessor() || |
| @@ -154,24 +147,20 @@ void GrOptDrawState::setOutputStateInfo(const GrDrawState& ds, |
| if (kZero_GrBlendCoeff == fDstBlend) { |
| // write the coverage value to second color |
| descInfo->fSecondaryOutputType = GrProgramDesc::kCoverage_SecondaryOutputType; |
| - *separateCoverageFromColor = true; |
| fDstBlend = (GrBlendCoeff)GrGpu::kIS2C_GrBlendCoeff; |
| } else if (kSA_GrBlendCoeff == fDstBlend) { |
| // SA dst coeff becomes 1-(1-SA)*coverage when dst is partially covered. |
| descInfo->fSecondaryOutputType = GrProgramDesc::kCoverageISA_SecondaryOutputType; |
| - *separateCoverageFromColor = true; |
| fDstBlend = (GrBlendCoeff)GrGpu::kIS2C_GrBlendCoeff; |
| } else if (kSC_GrBlendCoeff == fDstBlend) { |
| // SA dst coeff becomes 1-(1-SA)*coverage when dst is partially covered. |
| descInfo->fSecondaryOutputType = GrProgramDesc::kCoverageISC_SecondaryOutputType; |
| - *separateCoverageFromColor = true; |
| fDstBlend = (GrBlendCoeff)GrGpu::kIS2C_GrBlendCoeff; |
| } |
| } else if (descInfo->fReadsDst && |
| kOne_GrBlendCoeff == fSrcBlend && |
| kZero_GrBlendCoeff == fDstBlend) { |
| descInfo->fPrimaryOutputType = GrProgramDesc::kCombineWithDst_PrimaryOutputType; |
| - *separateCoverageFromColor = true; |
| } |
| } |
| } |