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

Unified Diff: src/gpu/GrOptDrawState.cpp

Issue 656503002: Move willUseInputColor check to computeInvariantOutput (Closed) Base URL: https://skia.googlesource.com/skia.git@addMultFlag
Patch Set: Rebase2 Created 6 years, 2 months 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/effects/SkTableColorFilter.cpp ('k') | src/gpu/GrProcessor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrOptDrawState.cpp
diff --git a/src/gpu/GrOptDrawState.cpp b/src/gpu/GrOptDrawState.cpp
index 7c8710f7d6466fd8d6432732c0af904132a2f0b4..40e0c6ce1fbb4a920caa8a2cf8874e5fd0b97544 100644
--- a/src/gpu/GrOptDrawState.cpp
+++ b/src/gpu/GrOptDrawState.cpp
@@ -244,16 +244,19 @@ void GrOptDrawState::computeEffectiveColorStages(const GrDrawState& ds, int* fir
for (int i = 0; i < ds.numColorStages(); ++i) {
const GrFragmentProcessor* fp = ds.getColorStage(i).getProcessor();
- if (!fp->willUseInputColor()) {
+ fp->computeInvariantOutput(&inout);
+ if (!inout.fWillUseInputColor) {
*firstColorStageIdx = i;
fInputColorIsUsed = false;
}
- fp->computeInvariantOutput(&inout);
if (kRGBA_GrColorComponentFlags == inout.fValidFlags) {
*firstColorStageIdx = i + 1;
fColor = inout.fColor;
fInputColorIsUsed = true;
*fixedFunctionVAToRemove |= 0x1 << kColor_GrVertexAttribBinding;
+ // Since we are clearing all previous color stages we are in a state where we have found
+ // zero stages that don't multiply the inputColor.
+ inout.fNonMulStageFound = false;
}
}
}
@@ -267,9 +270,11 @@ void GrOptDrawState::computeEffectiveCoverageStages(const GrDrawState& ds,
// Don't do any optimizations on coverage stages. It should not be the case where we do not use
// input coverage in an effect
#ifdef OptCoverageStages
+ GrProcessor::InvariantOutput inout;
for (int i = 0; i < ds.numCoverageStages(); ++i) {
- const GrProcessor* processor = ds.getCoverageStage(i).getProcessor();
- if (!processor->willUseInputColor()) {
+ const GrFragmentProcessor* fp = ds.getCoverageStage(i).getProcessor();
+ fp->computeInvariantOutput(&inout);
+ if (!inout.fWillUseInputColor) {
*firstCoverageStageIdx = i;
fInputCoverageIsUsed = false;
}
« no previous file with comments | « src/effects/SkTableColorFilter.cpp ('k') | src/gpu/GrProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698