diff --git a/src/gpu/GrDrawState.cpp b/src/gpu/GrDrawState.cpp index 591e157129..a3850b087e 100644 --- a/src/gpu/GrDrawState.cpp +++ b/src/gpu/GrDrawState.cpp @@ -371,6 +371,13 @@ GrDrawState::BlendOptFlags GrDrawState::getBlendOpts(bool forceCoverage, return kCoverageAsAlpha_BlendOptFlag; } } + if (kOne_GrBlendCoeff == *srcCoeff && + kZero_GrBlendCoeff == *dstCoeff && + this->willEffectReadDstColor()) { + // In this case the shader will fully resolve the color, coverage, and dst and we don't + // need blending. + return kDisableBlend_BlendOptFlag; + } return kNone_BlendOpt; } diff --git a/src/gpu/gl/GrGLProgramDesc.cpp b/src/gpu/gl/GrGLProgramDesc.cpp index 532923a19c..e8812fade7 100644 --- a/src/gpu/gl/GrGLProgramDesc.cpp +++ b/src/gpu/gl/GrGLProgramDesc.cpp @@ -178,8 +178,8 @@ void GrGLProgramDesc::Build(const GrDrawState& drawState, desc->fFirstCoverageStage = firstCoverageStage; } } else if (readsDst && - kOne_GrBlendCoeff == drawState.getSrcBlendCoeff() && - kZero_GrBlendCoeff == drawState.getDstBlendCoeff()) { + kOne_GrBlendCoeff == srcCoeff && + kZero_GrBlendCoeff == dstCoeff) { desc->fCoverageOutput = kCombineWithDst_CoverageOutput; desc->fFirstCoverageStage = firstCoverageStage; }