Remove unused calcPOIs with color/coverage input.

BUG=skia:

Review URL: https://codereview.chromium.org/1311763003
This commit is contained in:
egdaniel 2015-08-24 06:42:32 -07:00 committed by Commit bot
parent bda7da8ea6
commit 06a7f9c73b
2 changed files with 3 additions and 70 deletions

View File

@ -18,11 +18,7 @@
GrPipelineBuilder::GrPipelineBuilder()
: fProcDataManager(SkNEW(GrProcessorDataManager))
, fFlags(0x0)
, fDrawFace(kBoth_DrawFace)
, fColorProcInfoValid(false)
, fCoverageProcInfoValid(false)
, fColorCache(GrColor_ILLEGAL)
, fCoverageCache(GrColor_ILLEGAL) {
, fDrawFace(kBoth_DrawFace) {
SkDEBUGCODE(fBlockEffectRemovalCnt = 0;)
}
@ -37,16 +33,6 @@ GrPipelineBuilder& GrPipelineBuilder::operator=(const GrPipelineBuilder& that) {
fCoverageStages = that.fCoverageStages;
fClip = that.fClip;
fColorProcInfoValid = that.fColorProcInfoValid;
fCoverageProcInfoValid = that.fCoverageProcInfoValid;
fColorCache = that.fColorCache;
fCoverageCache = that.fCoverageCache;
if (fColorProcInfoValid) {
fColorProcInfo = that.fColorProcInfo;
}
if (fCoverageProcInfoValid) {
fCoverageProcInfo = that.fCoverageProcInfo;
}
return *this;
}
@ -82,12 +68,6 @@ GrPipelineBuilder::GrPipelineBuilder(const GrPaint& paint, GrRenderTarget* rt, c
this->setState(GrPipelineBuilder::kDither_Flag, paint.isDither());
this->setState(GrPipelineBuilder::kHWAntialias_Flag,
rt->isUnifiedMultisampled() && paint.isAntiAlias());
fColorProcInfoValid = false;
fCoverageProcInfoValid = false;
fColorCache = GrColor_ILLEGAL;
fCoverageCache = GrColor_ILLEGAL;
}
//////////////////////////////////////////////////////////////////////////////s
@ -109,10 +89,7 @@ void GrPipelineBuilder::AutoRestoreFragmentProcessorState::set(
int n = fPipelineBuilder->numCoverageFragmentStages() - fCoverageEffectCnt;
SkASSERT(n >= 0);
fPipelineBuilder->fCoverageStages.pop_back_n(n);
if (m + n > 0) {
fPipelineBuilder->fColorProcInfoValid = false;
fPipelineBuilder->fCoverageProcInfoValid = false;
}
SkDEBUGCODE(--fPipelineBuilder->fBlockEffectRemovalCnt;)
fPipelineBuilder->getProcessorDataManager()->restoreToSaveMarker(/*fSaveMarker*/);
}
@ -135,45 +112,19 @@ GrPipelineBuilder::~GrPipelineBuilder() {
void GrPipelineBuilder::calcColorInvariantOutput(const GrPrimitiveProcessor* pp) const {
fColorProcInfo.calcColorWithPrimProc(pp, fColorStages.begin(), this->numColorFragmentStages());
fColorProcInfoValid = false;
}
void GrPipelineBuilder::calcCoverageInvariantOutput(const GrPrimitiveProcessor* pp) const {
fCoverageProcInfo.calcCoverageWithPrimProc(pp, fCoverageStages.begin(),
this->numCoverageFragmentStages());
fCoverageProcInfoValid = false;
this->numCoverageFragmentStages());
}
void GrPipelineBuilder::calcColorInvariantOutput(const GrDrawBatch* batch) const {
fColorProcInfo.calcColorWithBatch(batch, fColorStages.begin(), this->numColorFragmentStages());
fColorProcInfoValid = false;
}
void GrPipelineBuilder::calcCoverageInvariantOutput(const GrDrawBatch* batch) const {
fCoverageProcInfo.calcCoverageWithBatch(batch, fCoverageStages.begin(),
this->numCoverageFragmentStages());
fCoverageProcInfoValid = false;
}
void GrPipelineBuilder::calcColorInvariantOutput(GrColor color) const {
if (!fColorProcInfoValid || color != fColorCache) {
GrColorComponentFlags flags = kRGBA_GrColorComponentFlags;
fColorProcInfo.calcWithInitialValues(fColorStages.begin(),this->numColorFragmentStages(),
color, flags, false);
fColorProcInfoValid = true;
fColorCache = color;
}
}
void GrPipelineBuilder::calcCoverageInvariantOutput(GrColor coverage) const {
if (!fCoverageProcInfoValid || coverage != fCoverageCache) {
GrColorComponentFlags flags = kRGBA_GrColorComponentFlags;
fCoverageProcInfo.calcWithInitialValues(fCoverageStages.begin(),
this->numCoverageFragmentStages(), coverage, flags,
true);
fCoverageProcInfoValid = true;
fCoverageCache = coverage;
}
}

View File

@ -69,14 +69,12 @@ public:
const GrFragmentProcessor* addColorProcessor(const GrFragmentProcessor* effect) {
SkASSERT(effect);
SkNEW_APPEND_TO_TARRAY(&fColorStages, GrFragmentStage, (effect));
fColorProcInfoValid = false;
return effect;
}
const GrFragmentProcessor* addCoverageProcessor(const GrFragmentProcessor* effect) {
SkASSERT(effect);
SkNEW_APPEND_TO_TARRAY(&fCoverageStages, GrFragmentStage, (effect));
fCoverageProcInfoValid = false;
return effect;
}
@ -437,18 +435,6 @@ private:
void calcColorInvariantOutput(const GrDrawBatch*) const;
void calcCoverageInvariantOutput(const GrDrawBatch*) const;
/**
* If fColorProcInfoValid is false, function calculates the invariant output for the color
* processors and results are stored in fColorProcInfo.
*/
void calcColorInvariantOutput(GrColor) const;
/**
* If fCoverageProcInfoValid is false, function calculates the invariant output for the coverage
* processors and results are stored in fCoverageProcInfo.
*/
void calcCoverageInvariantOutput(GrColor) const;
// Some of the auto restore objects assume that no effects are removed during their lifetime.
// This is used to assert that this condition holds.
SkDEBUGCODE(mutable int fBlockEffectRemovalCnt;)
@ -467,10 +453,6 @@ private:
mutable GrProcOptInfo fColorProcInfo;
mutable GrProcOptInfo fCoverageProcInfo;
mutable bool fColorProcInfoValid;
mutable bool fCoverageProcInfoValid;
mutable GrColor fColorCache;
mutable GrColor fCoverageCache;
friend class GrPipeline;
};