Add XP to handle the cases where we disable color write.
BUG=skia:
Review URL: https://codereview.chromium.org/787233003
diff --git a/src/gpu/GrDrawState.cpp b/src/gpu/GrDrawState.cpp
index 883c74b..68cd01c 100644
--- a/src/gpu/GrDrawState.cpp
+++ b/src/gpu/GrDrawState.cpp
@@ -184,8 +184,7 @@
// TODO we want to cache the result of this call, but we can probably clean up the interface
// so we don't have to pass in a seemingly known coverage
this->calcCoverageInvariantOutput(GrColor_WHITE);
- return fXPFactory->canApplyCoverage(fColorProcInfo, fCoverageProcInfo,
- this->isColorWriteDisabled());
+ return fXPFactory->canApplyCoverage(fColorProcInfo, fCoverageProcInfo);
}
//////////////////////////////////////////////////////////////////////////////s
@@ -193,21 +192,8 @@
bool GrDrawState::willEffectReadDstColor(const GrPrimitiveProcessor* pp) const {
this->calcColorInvariantOutput(pp);
this->calcCoverageInvariantOutput(pp);
- // TODO: Remove need to create the XP here.
- // Also once all custom blends are turned into XPs we can remove the need
- // to check other stages since only xp's will be able to read dst
- SkAutoTUnref<GrXferProcessor> xferProcessor(fXPFactory->createXferProcessor(fColorProcInfo,
- fCoverageProcInfo));
- if (xferProcessor && xferProcessor->willReadDstColor()) {
- return true;
- }
- if (!this->isColorWriteDisabled()) {
- if (fColorProcInfo.readsDst()) {
- return true;
- }
- }
- return fCoverageProcInfo.readsDst();
+ return fXPFactory->willReadDst(fColorProcInfo, fCoverageProcInfo);
}
void GrDrawState::AutoRestoreEffects::set(GrDrawState* ds) {
@@ -341,8 +327,7 @@
this->calcCoverageInvariantOutput(pp);
GrXPFactory::InvariantOutput output;
- fXPFactory->getInvariantOutput(fColorProcInfo, fCoverageProcInfo, this->isColorWriteDisabled(),
- &output);
+ fXPFactory->getInvariantOutput(fColorProcInfo, fCoverageProcInfo, &output);
return output.fWillBlendWithDst;
}