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

Unified Diff: src/gpu/GrProcOptInfo.cpp

Issue 794843002: Revert of Remove GP from drawstate, revision of invariant output for GP (Closed) Base URL: https://skia.googlesource.com/skia.git@color-to-gp
Patch Set: 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/GrProcOptInfo.h ('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/GrProcOptInfo.cpp
diff --git a/src/gpu/GrProcOptInfo.cpp b/src/gpu/GrProcOptInfo.cpp
index ebcf016075dd34b55ce6178ff649c84a237a4ba2..a84ac2e17fb45dcfb2a9f556b2a628dd68bcf53f 100644
--- a/src/gpu/GrProcOptInfo.cpp
+++ b/src/gpu/GrProcOptInfo.cpp
@@ -11,57 +11,37 @@
#include "GrFragmentStage.h"
#include "GrGeometryProcessor.h"
-void GrProcOptInfo::calcColorWithPrimProc(const GrPrimitiveProcessor* primProc,
- const GrFragmentStage* stages,
- int stageCount) {
- GrInitInvariantOutput out;
- primProc->getInvariantOutputColor(&out);
- fInOut.reset(out);
- this->internalCalc(stages, stageCount, primProc->willReadFragmentPosition());
-}
-
-void GrProcOptInfo::calcCoverageWithPrimProc(const GrPrimitiveProcessor* primProc,
- const GrFragmentStage* stages,
- int stageCount) {
- GrInitInvariantOutput out;
- primProc->getInvariantOutputCoverage(&out);
- fInOut.reset(out);
- this->internalCalc(stages, stageCount, primProc->willReadFragmentPosition());
-}
-
void GrProcOptInfo::calcWithInitialValues(const GrFragmentStage* stages,
int stageCount,
GrColor startColor,
GrColorComponentFlags flags,
- bool areCoverageStages) {
- GrInitInvariantOutput out;
- out.fIsSingleComponent = areCoverageStages;
- out.fColor = startColor;
- out.fValidFlags = flags;
- this->internalCalc(stages, stageCount, false);
-}
-
-void GrProcOptInfo::internalCalc(const GrFragmentStage* stages,
- int stageCount,
- bool initWillReadFragmentPosition) {
+ bool areCoverageStages,
+ const GrGeometryProcessor* gp) {
+ fInOut.reset(startColor, flags, areCoverageStages);
fFirstEffectStageIndex = 0;
fInputColorIsUsed = true;
- fInputColor = fInOut.color();
+ fInputColor = startColor;
fRemoveVertexAttrib = false;
fReadsDst = false;
- fReadsFragPosition = initWillReadFragmentPosition;
+ fReadsFragPosition = false;
+
+ if (areCoverageStages && gp) {
+ gp->computeInvariantOutput(&fInOut);
+ }
for (int i = 0; i < stageCount; ++i) {
const GrFragmentProcessor* processor = stages[i].getProcessor();
fInOut.resetWillUseInputColor();
processor->computeInvariantOutput(&fInOut);
- SkDEBUGCODE(fInOut.validate());
+#ifdef SK_DEBUG
+ fInOut.validate();
+#endif
if (!fInOut.willUseInputColor()) {
fFirstEffectStageIndex = i;
fInputColorIsUsed = false;
// Reset these since we don't care if previous stages read these values
fReadsDst = false;
- fReadsFragPosition = initWillReadFragmentPosition;
+ fReadsFragPosition = false;
}
if (processor->willReadDstColor()) {
fReadsDst = true;
@@ -79,7 +59,8 @@
fInOut.resetNonMulStageFound();
// Reset these since we don't care if previous stages read these values
fReadsDst = false;
- fReadsFragPosition = initWillReadFragmentPosition;
+ fReadsFragPosition = false;
}
}
}
+
« no previous file with comments | « src/gpu/GrProcOptInfo.h ('k') | src/gpu/GrProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698