diff options
Diffstat (limited to 'src/gpu/GrOptDrawState.cpp')
-rw-r--r-- | src/gpu/GrOptDrawState.cpp | 40 |
1 files changed, 8 insertions, 32 deletions
diff --git a/src/gpu/GrOptDrawState.cpp b/src/gpu/GrOptDrawState.cpp index bc1ce7dc93..8d28f446b2 100644 --- a/src/gpu/GrOptDrawState.cpp +++ b/src/gpu/GrOptDrawState.cpp @@ -18,15 +18,11 @@ GrOptDrawState::GrOptDrawState(const GrDrawState& drawState, const GrDrawTargetCaps& caps, const GrScissorState& scissorState, const GrDeviceCoordTexture* dstCopy, - GrGpu::DrawType drawType) - : fFinalized(false) { + GrGpu::DrawType drawType) { fDrawType = drawType; - fPrimitiveProcessor.reset(primProc); - - - const GrProcOptInfo& colorPOI = drawState.colorProcInfo(fPrimitiveProcessor); - const GrProcOptInfo& coveragePOI = drawState.coverageProcInfo(fPrimitiveProcessor); + const GrProcOptInfo& colorPOI = drawState.colorProcInfo(primProc); + const GrProcOptInfo& coveragePOI = drawState.coverageProcInfo(primProc); // Create XferProcessor from DS's XPFactory SkAutoTUnref<GrXferProcessor> xferProcessor( @@ -112,12 +108,10 @@ GrOptDrawState::GrOptDrawState(const GrDrawState& drawState, } // let the GP init the batch tracker - GrGeometryProcessor::InitBT init; - init.fColorIgnored = SkToBool(optFlags & GrXferProcessor::kIgnoreColor_OptFlag); - init.fOverrideColor = init.fColorIgnored ? GrColor_ILLEGAL : overrideColor; - init.fCoverageIgnored = SkToBool(optFlags & GrXferProcessor::kIgnoreCoverage_OptFlag); - init.fUsesLocalCoords = usesLocalCoords; - fPrimitiveProcessor->initBatchTracker(&fBatchTracker, init); + fInitBT.fColorIgnored = SkToBool(optFlags & GrXferProcessor::kIgnoreColor_OptFlag); + fInitBT.fOverrideColor = fInitBT.fColorIgnored ? GrColor_ILLEGAL : overrideColor; + fInitBT.fCoverageIgnored = SkToBool(optFlags & GrXferProcessor::kIgnoreCoverage_OptFlag); + fInitBT.fUsesLocalCoords = usesLocalCoords; } void GrOptDrawState::adjustProgramFromOptimizations(const GrDrawState& ds, @@ -144,18 +138,9 @@ void GrOptDrawState::adjustProgramFromOptimizations(const GrDrawState& ds, } } -void GrOptDrawState::finalize(GrGpu* gpu) { - gpu->buildProgramDesc(*this, fDescInfo, fDrawType, &fDesc); - fFinalized = true; -} - //////////////////////////////////////////////////////////////////////////////// -bool GrOptDrawState::combineIfPossible(const GrOptDrawState& that) { - if (fDescInfo != that.fDescInfo) { - return false; - } - +bool GrOptDrawState::isEqual(const GrOptDrawState& that) const { if (this->getRenderTarget() != that.getRenderTarget() || this->fFragmentStages.count() != that.fFragmentStages.count() || this->fNumColorStages != that.fNumColorStages || @@ -168,12 +153,6 @@ bool GrOptDrawState::combineIfPossible(const GrOptDrawState& that) { return false; } - if (!this->getPrimitiveProcessor()->canMakeEqual(fBatchTracker, - *that.getPrimitiveProcessor(), - that.getBatchTracker())) { - return false; - } - if (!this->getXferProcessor()->isEqual(*that.getXferProcessor())) { return false; } @@ -186,9 +165,6 @@ bool GrOptDrawState::combineIfPossible(const GrOptDrawState& that) { return false; } } - - // Now update the GrPrimitiveProcessor's batch tracker - fPrimitiveProcessor->makeEqual(&fBatchTracker, that.getBatchTracker()); return true; } |