Index: src/gpu/GrOptDrawState.cpp |
diff --git a/src/gpu/GrOptDrawState.cpp b/src/gpu/GrOptDrawState.cpp |
index 647095f18da547950e5cab4827e80d4200d39365..6ed589354db6dbd07f68575dfe3f6e52d477e799 100644 |
--- a/src/gpu/GrOptDrawState.cpp |
+++ b/src/gpu/GrOptDrawState.cpp |
@@ -41,7 +41,8 @@ GrOptDrawState::GrOptDrawState(const GrDrawState& drawState, |
drawState.isColorWriteDisabled(), |
drawState.getStencil().doesWrite(), |
&fColor, |
- &fCoverage); |
+ &fCoverage, |
+ caps); |
} |
// When path rendering the stencil settings are not always set on the draw state |
@@ -143,41 +144,6 @@ GrOptDrawState::GrOptDrawState(const GrDrawState& drawState, |
init.fCoverage = this->getCoverage(); |
fGeometryProcessor->initBatchTracker(&fBatchTracker, init); |
} |
- |
- this->setOutputStateInfo(drawState, optFlags, caps); |
-} |
- |
-void GrOptDrawState::setOutputStateInfo(const GrDrawState& ds, |
- GrXferProcessor::OptFlags optFlags, |
- const GrDrawTargetCaps& caps) { |
- // Set this default and then possibly change our mind if there is coverage. |
- fDescInfo.fPrimaryOutputType = GrProgramDesc::kModulate_PrimaryOutputType; |
- fDescInfo.fSecondaryOutputType = GrProgramDesc::kNone_SecondaryOutputType; |
- |
- // Determine whether we should use dual source blending or shader code to keep coverage |
- // separate from color. |
- bool keepCoverageSeparate = !(optFlags & GrXferProcessor::kSetCoverageDrawing_OptFlag); |
- if (keepCoverageSeparate && !ds.hasSolidCoverage()) { |
- if (caps.dualSourceBlendingSupport()) { |
- if (kZero_GrBlendCoeff == fDstBlend) { |
- // write the coverage value to second color |
- fDescInfo.fSecondaryOutputType = GrProgramDesc::kCoverage_SecondaryOutputType; |
- fDstBlend = (GrBlendCoeff)GrGpu::kIS2C_GrBlendCoeff; |
- } else if (kSA_GrBlendCoeff == fDstBlend) { |
- // SA dst coeff becomes 1-(1-SA)*coverage when dst is partially covered. |
- fDescInfo.fSecondaryOutputType = GrProgramDesc::kCoverageISA_SecondaryOutputType; |
- fDstBlend = (GrBlendCoeff)GrGpu::kIS2C_GrBlendCoeff; |
- } else if (kSC_GrBlendCoeff == fDstBlend) { |
- // SA dst coeff becomes 1-(1-SA)*coverage when dst is partially covered. |
- fDescInfo.fSecondaryOutputType = GrProgramDesc::kCoverageISC_SecondaryOutputType; |
- fDstBlend = (GrBlendCoeff)GrGpu::kIS2C_GrBlendCoeff; |
- } |
- } else if (fDescInfo.fReadsDst && |
- kOne_GrBlendCoeff == fSrcBlend && |
- kZero_GrBlendCoeff == fDstBlend) { |
- fDescInfo.fPrimaryOutputType = GrProgramDesc::kCombineWithDst_PrimaryOutputType; |
- } |
- } |
} |
void GrOptDrawState::adjustProgramFromOptimizations(const GrDrawState& ds, |
@@ -258,6 +224,10 @@ bool GrOptDrawState::operator== (const GrOptDrawState& that) const { |
return false; |
} |
+ if (!this->getXferProcessor()->isEqual(*that.getXferProcessor())) { |
+ return false; |
+ } |
+ |
// The program desc comparison should have already assured that the stage counts match. |
SkASSERT(this->numFragmentStages() == that.numFragmentStages()); |
for (int i = 0; i < this->numFragmentStages(); i++) { |