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

Unified Diff: src/gpu/GrOptDrawState.cpp

Issue 719203002: Add GrProcOptInfo class to track various output information for color and coverage stages. (Closed) Base URL: https://skia.googlesource.com/skia.git@moveIO
Patch Set: initialize values Created 6 years, 1 month 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/GrInvariantOutput.cpp ('k') | src/gpu/GrPaint.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 7d8b06c129cbb570d45d8622dd4483fcd3a5f47c..0f2fcf070b373137138020af0e757ffcfdfef940 100644
--- a/src/gpu/GrOptDrawState.cpp
+++ b/src/gpu/GrOptDrawState.cpp
@@ -11,7 +11,7 @@
#include "GrDrawState.h"
#include "GrDrawTargetCaps.h"
#include "GrGpu.h"
-#include "GrInvariantOutput.h"
+#include "GrProcOptInfo.h"
GrOptDrawState::GrOptDrawState(const GrDrawState& drawState,
BlendOptFlags blendOptFlags,
@@ -239,23 +239,14 @@ void GrOptDrawState::computeEffectiveColorStages(const GrDrawState& ds,
color = 0;
}
}
- GrInvariantOutput inout(color, flags, false);
-
- for (int i = 0; i < ds.numColorStages(); ++i) {
- const GrFragmentProcessor* fp = ds.getColorStage(i).getProcessor();
- fp->computeInvariantOutput(&inout);
- if (!inout.willUseInputColor()) {
- *firstColorStageIdx = i;
- descInfo->fInputColorIsUsed = false;
- }
- if (kRGBA_GrColorComponentFlags == inout.validFlags()) {
- *firstColorStageIdx = i + 1;
- fColor = inout.color();
- descInfo->fInputColorIsUsed = true;
+ GrProcOptInfo poi;
+ if (ds.numColorStages() > 0) {
+ poi.calcWithInitialValues(&ds.getColorStage(0), ds.numColorStages(), color, flags, false);
+ *firstColorStageIdx = poi.firstEffectiveStageIndex();
+ descInfo->fInputColorIsUsed = poi.inputColorIsUsed();
+ fColor = poi.inputColorToEffectiveStage();
+ if (poi.removeVertexAttrib()) {
*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.resetNonMulStageFound();
}
}
}
« no previous file with comments | « src/gpu/GrInvariantOutput.cpp ('k') | src/gpu/GrPaint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698