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

Unified Diff: src/gpu/GrPipelineBuilder.cpp

Issue 862823004: Revert of GrBatchPrototype (Closed) Base URL: https://skia.googlesource.com/skia.git@lc2
Patch Set: Created 5 years, 11 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/gpu/GrPipelineBuilder.h ('k') | src/gpu/GrProcOptInfo.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrPipelineBuilder.cpp
diff --git a/src/gpu/GrPipelineBuilder.cpp b/src/gpu/GrPipelineBuilder.cpp
index 90aee748c9108411b46ede0dbe2ef7059e6045d5..f329c05b91ed89829bd5463517600a5d1fe4bdfa 100644
--- a/src/gpu/GrPipelineBuilder.cpp
+++ b/src/gpu/GrPipelineBuilder.cpp
@@ -20,7 +20,9 @@
, fColorProcInfoValid(false)
, fCoverageProcInfoValid(false)
, fColorCache(GrColor_ILLEGAL)
- , fCoverageCache(GrColor_ILLEGAL) {
+ , fCoverageCache(GrColor_ILLEGAL)
+ , fColorPrimProc(NULL)
+ , fCoveragePrimProc(NULL) {
SkDEBUGCODE(fBlockEffectRemovalCnt = 0;)
}
@@ -37,6 +39,8 @@
fCoverageProcInfoValid = that.fCoverageProcInfoValid;
fColorCache = that.fColorCache;
fCoverageCache = that.fCoverageCache;
+ fColorPrimProc = that.fColorPrimProc;
+ fCoveragePrimProc = that.fCoveragePrimProc;
if (fColorProcInfoValid) {
fColorProcInfo = that.fColorProcInfo;
}
@@ -80,6 +84,9 @@
fColorCache = GrColor_ILLEGAL;
fCoverageCache = GrColor_ILLEGAL;
+
+ fColorPrimProc = NULL;
+ fCoveragePrimProc = NULL;
}
////////////////////////////////////////////////////////////////////////////////
@@ -154,28 +161,21 @@
}
void GrPipelineBuilder::calcColorInvariantOutput(const GrPrimitiveProcessor* pp) const {
- fColorProcInfo.calcColorWithPrimProc(pp, fColorStages.begin(), this->numColorStages());
- fColorProcInfoValid = false;
-
+ if (!fColorProcInfoValid || fColorPrimProc != pp) {
+ fColorProcInfo.calcColorWithPrimProc(pp, fColorStages.begin(), this->numColorStages());
+ fColorProcInfoValid = true;
+ fColorPrimProc = pp;
+ }
}
void GrPipelineBuilder::calcCoverageInvariantOutput(const GrPrimitiveProcessor* pp) const {
- fCoverageProcInfo.calcCoverageWithPrimProc(pp, fCoverageStages.begin(),
- this->numCoverageStages());
- fCoverageProcInfoValid = false;
+ if (!fCoverageProcInfoValid || fCoveragePrimProc != pp) {
+ fCoverageProcInfo.calcCoverageWithPrimProc(pp, fCoverageStages.begin(),
+ this->numCoverageStages());
+ fCoverageProcInfoValid = true;
+ fCoveragePrimProc = pp;
+ }
}
-
-void GrPipelineBuilder::calcColorInvariantOutput(const GrBatch* batch) const {
- fColorProcInfo.calcColorWithBatch(batch, fColorStages.begin(), this->numColorStages());
- fColorProcInfoValid = false;
-}
-
-void GrPipelineBuilder::calcCoverageInvariantOutput(const GrBatch* batch) const {
- fCoverageProcInfo.calcCoverageWithBatch(batch, fCoverageStages.begin(),
- this->numCoverageStages());
- fCoverageProcInfoValid = false;
-}
-
void GrPipelineBuilder::calcColorInvariantOutput(GrColor color) const {
if (!fColorProcInfoValid || color != fColorCache) {
« no previous file with comments | « src/gpu/GrPipelineBuilder.h ('k') | src/gpu/GrProcOptInfo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698