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/GrOptDrawState.cpp

Issue 815643005: Move program descriptor and primitive processor off of optstate (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: bug fix 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/GrOptDrawState.h ('k') | src/gpu/GrTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrOptDrawState.cpp
diff --git a/src/gpu/GrOptDrawState.cpp b/src/gpu/GrOptDrawState.cpp
index bc1ce7dc930258052749c203fde00296401dd236..8d28f446b27912d2d6e6687ef54485a73a93e326 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;
}
« no previous file with comments | « src/gpu/GrOptDrawState.h ('k') | src/gpu/GrTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698