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

Unified Diff: src/gpu/GrProcOptInfo.cpp

Issue 1734163002: Replace fWillReadFragmentPosition with a bitfield (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 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
Index: src/gpu/GrProcOptInfo.cpp
diff --git a/src/gpu/GrProcOptInfo.cpp b/src/gpu/GrProcOptInfo.cpp
index bfd9e9ec8ceabd638a3e50179bdfe1aff9216348..4410d7136c710caf7039d9ac017b6beef114f786 100644
--- a/src/gpu/GrProcOptInfo.cpp
+++ b/src/gpu/GrProcOptInfo.cpp
@@ -23,7 +23,7 @@ void GrProcOptInfo::calcWithInitialValues(const GrFragmentProcessor * const proc
out.fValidFlags = flags;
out.fIsLCDCoverage = isLCD;
fInOut.reset(out);
- this->internalCalc(processors, cnt, false);
+ this->internalCalc(processors, cnt);
}
void GrProcOptInfo::initUsingInvariantOutput(GrInitInvariantOutput invOutput) {
@@ -31,16 +31,14 @@ void GrProcOptInfo::initUsingInvariantOutput(GrInitInvariantOutput invOutput) {
}
void GrProcOptInfo::completeCalculations(const GrFragmentProcessor * const processors[], int cnt) {
- this->internalCalc(processors, cnt, false);
+ this->internalCalc(processors, cnt);
}
-void GrProcOptInfo::internalCalc(const GrFragmentProcessor* const processors[],
- int cnt,
- bool initWillReadFragmentPosition) {
+void GrProcOptInfo::internalCalc(const GrFragmentProcessor* const processors[], int cnt) {
fFirstEffectiveProcessorIndex = 0;
fInputColorIsUsed = true;
fInputColor = fInOut.color();
- fReadsFragPosition = initWillReadFragmentPosition;
+ fBuiltInState = GrProcessor::kNone_BuiltInState;
for (int i = 0; i < cnt; ++i) {
const GrFragmentProcessor* processor = processors[i];
@@ -50,12 +48,10 @@ void GrProcOptInfo::internalCalc(const GrFragmentProcessor* const processors[],
if (!fInOut.willUseInputColor()) {
fFirstEffectiveProcessorIndex = i;
fInputColorIsUsed = false;
- // Reset these since we don't care if previous stages read these values
- fReadsFragPosition = initWillReadFragmentPosition;
- }
- if (processor->willReadFragmentPosition()) {
- fReadsFragPosition = true;
+ // Reset these since we will be removing any previous stages that read these values.
+ fBuiltInState = GrProcessor::kNone_BuiltInState;
}
+ fBuiltInState |= processor->builtInState();
if (kRGBA_GrColorComponentFlags == fInOut.validFlags()) {
fFirstEffectiveProcessorIndex = i + 1;
fInputColor = fInOut.color();
@@ -63,8 +59,8 @@ void GrProcOptInfo::internalCalc(const GrFragmentProcessor* const processors[],
// 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.
fInOut.resetNonMulStageFound();
- // Reset these since we don't care if previous stages read these values
- fReadsFragPosition = initWillReadFragmentPosition;
+ // Reset these since we will be removing all processors.
+ fBuiltInState = GrProcessor::kNone_BuiltInState;
Chris Dalton 2016/02/25 19:19:03 FYI, this is bad news for a processor that modifie
joshualitt 2016/02/25 20:50:27 Yea, we don't actually remove processors from the
bsalomon 2016/02/25 21:11:03 Yeah, querying willModifySampleMask could be the i
}
}
}

Powered by Google App Engine
This is Rietveld 408576698