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

Unified Diff: src/gpu/GrOptDrawState.cpp

Issue 746423007: Draft change to start pulling uniform color into GP (Closed) Base URL: https://skia.googlesource.com/skia.git@no_factories
Patch Set: Created 6 years 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
Index: src/gpu/GrOptDrawState.cpp
diff --git a/src/gpu/GrOptDrawState.cpp b/src/gpu/GrOptDrawState.cpp
index d95bd3b7c42017a2526f4fd3e7fcb662bed8502e..ef73b244e3a777ec180a95adad1ef0a8549d2fcf 100644
--- a/src/gpu/GrOptDrawState.cpp
+++ b/src/gpu/GrOptDrawState.cpp
@@ -123,8 +123,10 @@ GrOptDrawState::GrOptDrawState(const GrDrawState& drawState,
GrGeometryProcessor::InitBT init;
init.fOutputColor = fDescInfo.fInputColorIsUsed;
init.fOutputCoverage = fDescInfo.fInputCoverageIsUsed;
+ init.fRemoveColorAttr = !fDescInfo.fHasVertexColor;
+ init.fRemoveCoverageAttr = !fDescInfo.fHasVertexCoverage;
init.fColor = this->getColor();
- init.fCoverage = this->getCoverage();
+ init.fCoverage = this->getCoverageColor();
fGeometryProcessor->initBatchTracker(&fBatchTracker, init);
}
}
@@ -265,6 +267,11 @@ bool GrOptDrawState::operator== (const GrOptDrawState& that) const {
return false;
} else if (!this->getGeometryProcessor()->isEqual(*that.getGeometryProcessor())) {
bsalomon 2014/12/05 14:43:03 Should we get rid of isEqual() in favor of canBatc
return false;
+ } else if (this->getGeometryProcessor()->fNewStyle) {
+ if (!this->getGeometryProcessor()->canBatch(this->getBatchTracker(),
+ that.getBatchTracker())) {
+ return false;
+ }
}
} else if (that.hasGeometryProcessor()) {
return false;
@@ -278,6 +285,7 @@ bool GrOptDrawState::operator== (const GrOptDrawState& that) const {
return false;
}
}
+
return true;
}

Powered by Google App Engine
This is Rietveld 408576698