Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(206)

Unified Diff: src/gpu/GrDrawState.cpp

Issue 787233003: Add XP to handle the cases where we disable color write. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrDrawState.h ('k') | src/gpu/GrOptDrawState.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawState.cpp
diff --git a/src/gpu/GrDrawState.cpp b/src/gpu/GrDrawState.cpp
index 883c74b8ee65ef6b15dddf06143f23afa5529cf5..68cd01c3d5ac38fb6248593255a52c5d434b76d8 100644
--- a/src/gpu/GrDrawState.cpp
+++ b/src/gpu/GrDrawState.cpp
@@ -184,8 +184,7 @@ bool GrDrawState::canUseFracCoveragePrimProc(GrColor color, const GrDrawTargetCa
// 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::canUseFracCoveragePrimProc(GrColor color, const GrDrawTargetCa
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 @@ bool GrDrawState::willBlendWithDst(const GrPrimitiveProcessor* pp) const {
this->calcCoverageInvariantOutput(pp);
GrXPFactory::InvariantOutput output;
- fXPFactory->getInvariantOutput(fColorProcInfo, fCoverageProcInfo, this->isColorWriteDisabled(),
- &output);
+ fXPFactory->getInvariantOutput(fColorProcInfo, fCoverageProcInfo, &output);
return output.fWillBlendWithDst;
}
« no previous file with comments | « src/gpu/GrDrawState.h ('k') | src/gpu/GrOptDrawState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698