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

Unified Diff: src/gpu/GrPipelineBuilder.cpp

Issue 1307223004: Remove GrStagedProcessor, remove the word Stage as it applies to FPs (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix misresolve Created 5 years, 4 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 d7db20163b8819ccff2217ce44c31c72de566ee8..0af0eab27147601aeadb5bad87223a939c2f5c21 100644
--- a/src/gpu/GrPipelineBuilder.cpp
+++ b/src/gpu/GrPipelineBuilder.cpp
@@ -20,20 +20,6 @@ GrPipelineBuilder::GrPipelineBuilder()
SkDEBUGCODE(fBlockEffectRemovalCnt = 0;)
}
-GrPipelineBuilder& GrPipelineBuilder::operator=(const GrPipelineBuilder& that) {
- fProcDataManager.reset(new GrProcessorDataManager(*that.processorDataManager()));
- fRenderTarget.reset(SkSafeRef(that.fRenderTarget.get()));
- fFlags = that.fFlags;
- fStencilSettings = that.fStencilSettings;
- fDrawFace = that.fDrawFace;
- fXPFactory.reset(SkRef(that.getXPFactory()));
- fColorStages = that.fColorStages;
- fCoverageStages = that.fCoverageStages;
- fClip = that.fClip;
-
- return *this;
-}
-
GrPipelineBuilder::GrPipelineBuilder(const GrPaint& paint, GrRenderTarget* rt, const GrClip& clip) {
SkDEBUGCODE(fBlockEffectRemovalCnt = 0;)
@@ -41,15 +27,12 @@ GrPipelineBuilder::GrPipelineBuilder(const GrPaint& paint, GrRenderTarget* rt, c
fProcDataManager.reset(
const_cast<GrProcessorDataManager*>(SkRef(paint.processorDataManager())));
- fColorStages.reset();
- fCoverageStages.reset();
-
- for (int i = 0; i < paint.numColorStages(); ++i) {
- fColorStages.push_back(paint.getColorStage(i));
+ for (int i = 0; i < paint.numColorFragmentProcessors(); ++i) {
+ fColorFragmentProcessors.push_back(SkRef(paint.getColorFragmentProcessor(i)));
}
- for (int i = 0; i < paint.numCoverageStages(); ++i) {
- fCoverageStages.push_back(paint.getCoverageStage(i));
+ for (int i = 0; i < paint.numCoverageFragmentProcessors(); ++i) {
+ fCoverageFragmentProcessors.push_back(SkRef(paint.getCoverageFragmentProcessor(i)));
}
fXPFactory.reset(SkRef(paint.getXPFactory()));
@@ -80,21 +63,26 @@ bool GrPipelineBuilder::willXPNeedDstTexture(const GrCaps& caps,
void GrPipelineBuilder::AutoRestoreFragmentProcessorState::set(
const GrPipelineBuilder* pipelineBuilder) {
if (fPipelineBuilder) {
- int m = fPipelineBuilder->numColorFragmentStages() - fColorEffectCnt;
+ int m = fPipelineBuilder->numColorFragmentProcessors() - fColorEffectCnt;
SkASSERT(m >= 0);
- fPipelineBuilder->fColorStages.pop_back_n(m);
+ for (int i = 0; i < m; ++i) {
+ fPipelineBuilder->fColorFragmentProcessors.fromBack(i)->unref();
+ }
+ fPipelineBuilder->fColorFragmentProcessors.pop_back_n(m);
- int n = fPipelineBuilder->numCoverageFragmentStages() - fCoverageEffectCnt;
+ int n = fPipelineBuilder->numCoverageFragmentProcessors() - fCoverageEffectCnt;
SkASSERT(n >= 0);
- fPipelineBuilder->fCoverageStages.pop_back_n(n);
-
+ for (int i = 0; i < n; ++i) {
+ fPipelineBuilder->fCoverageFragmentProcessors.fromBack(i)->unref();
+ }
+ fPipelineBuilder->fCoverageFragmentProcessors.pop_back_n(n);
SkDEBUGCODE(--fPipelineBuilder->fBlockEffectRemovalCnt;)
fPipelineBuilder->getProcessorDataManager()->restoreToSaveMarker(/*fSaveMarker*/);
}
fPipelineBuilder = const_cast<GrPipelineBuilder*>(pipelineBuilder);
if (NULL != pipelineBuilder) {
- fColorEffectCnt = pipelineBuilder->numColorFragmentStages();
- fCoverageEffectCnt = pipelineBuilder->numCoverageFragmentStages();
+ fColorEffectCnt = pipelineBuilder->numColorFragmentProcessors();
+ fCoverageEffectCnt = pipelineBuilder->numCoverageFragmentProcessors();
SkDEBUGCODE(++pipelineBuilder->fBlockEffectRemovalCnt;)
fSaveMarker = pipelineBuilder->processorDataManager()->currentSaveMarker();
}
@@ -104,25 +92,33 @@ void GrPipelineBuilder::AutoRestoreFragmentProcessorState::set(
GrPipelineBuilder::~GrPipelineBuilder() {
SkASSERT(0 == fBlockEffectRemovalCnt);
+ for (int i = 0; i < fColorFragmentProcessors.count(); ++i) {
+ fColorFragmentProcessors[i]->unref();
+ }
+ for (int i = 0; i < fCoverageFragmentProcessors.count(); ++i) {
+ fCoverageFragmentProcessors[i]->unref();
+ }
}
////////////////////////////////////////////////////////////////////////////////
void GrPipelineBuilder::calcColorInvariantOutput(const GrPrimitiveProcessor* pp) const {
- fColorProcInfo.calcColorWithPrimProc(pp, fColorStages.begin(), this->numColorFragmentStages());
+ fColorProcInfo.calcColorWithPrimProc(pp, fColorFragmentProcessors.begin(),
+ this->numColorFragmentProcessors());
+
}
void GrPipelineBuilder::calcCoverageInvariantOutput(const GrPrimitiveProcessor* pp) const {
- fCoverageProcInfo.calcCoverageWithPrimProc(pp, fCoverageStages.begin(),
- this->numCoverageFragmentStages());
+ fCoverageProcInfo.calcCoverageWithPrimProc(pp, fCoverageFragmentProcessors.begin(),
+ this->numCoverageFragmentProcessors());
}
void GrPipelineBuilder::calcColorInvariantOutput(const GrDrawBatch* batch) const {
- fColorProcInfo.calcColorWithBatch(batch, fColorStages.begin(), this->numColorFragmentStages());
+ fColorProcInfo.calcColorWithBatch(batch, fColorFragmentProcessors.begin(),
+ this->numColorFragmentProcessors());
}
void GrPipelineBuilder::calcCoverageInvariantOutput(const GrDrawBatch* batch) const {
- fCoverageProcInfo.calcCoverageWithBatch(batch, fCoverageStages.begin(),
- this->numCoverageFragmentStages());
+ fCoverageProcInfo.calcCoverageWithBatch(batch, fCoverageFragmentProcessors.begin(),
+ this->numCoverageFragmentProcessors());
}
-
« 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