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

Unified Diff: src/gpu/GrDrawState.cpp

Issue 845103005: GrBatchPrototype (Closed) Base URL: https://skia.googlesource.com/skia.git@lc2
Patch Set: a bit more tweaking 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
Index: src/gpu/GrDrawState.cpp
diff --git a/src/gpu/GrDrawState.cpp b/src/gpu/GrDrawState.cpp
index 4ec39e7005a327d5470fafebfd40c61efa209f6d..38da149a5f54635b99e795a89b846ca5be9b0998 100644
--- a/src/gpu/GrDrawState.cpp
+++ b/src/gpu/GrDrawState.cpp
@@ -57,8 +57,6 @@ GrDrawState& GrDrawState::operator=(const GrDrawState& that) {
fCoverageProcInfoValid = that.fCoverageProcInfoValid;
fColorCache = that.fColorCache;
fCoverageCache = that.fCoverageCache;
- fColorPrimProc = that.fColorPrimProc;
- fCoveragePrimProc = that.fCoveragePrimProc;
if (fColorProcInfoValid) {
fColorProcInfo = that.fColorProcInfo;
}
@@ -85,9 +83,6 @@ void GrDrawState::onReset() {
fColorCache = GrColor_ILLEGAL;
fCoverageCache = GrColor_ILLEGAL;
-
- fColorPrimProc = NULL;
- fCoveragePrimProc = NULL;
}
void GrDrawState::setFromPaint(const GrPaint& paint, GrRenderTarget* rt) {
@@ -124,9 +119,6 @@ void GrDrawState::setFromPaint(const GrPaint& paint, GrRenderTarget* rt) {
fColorCache = GrColor_ILLEGAL;
fCoverageCache = GrColor_ILLEGAL;
-
- fColorPrimProc = NULL;
- fCoveragePrimProc = NULL;
}
////////////////////////////////////////////////////////////////////////////////
@@ -200,22 +192,34 @@ bool GrDrawState::willBlendWithDst(const GrPrimitiveProcessor* pp) const {
}
void GrDrawState::calcColorInvariantOutput(const GrPrimitiveProcessor* pp) const {
- if (!fColorProcInfoValid || fColorPrimProc != pp) {
- fColorProcInfo.calcColorWithPrimProc(pp, fColorStages.begin(), this->numColorStages());
- fColorProcInfoValid = true;
- fColorPrimProc = pp;
- }
+ fColorProcInfo.calcColorWithPrimProc(pp, fColorStages.begin(), this->numColorStages());
+ fColorProcInfoValid = false;
+
}
void GrDrawState::calcCoverageInvariantOutput(const GrPrimitiveProcessor* pp) const {
- if (!fCoverageProcInfoValid || fCoveragePrimProc != pp) {
- fCoverageProcInfo.calcCoverageWithPrimProc(pp, fCoverageStages.begin(),
- this->numCoverageStages());
- fCoverageProcInfoValid = true;
- fCoveragePrimProc = pp;
- }
+ fCoverageProcInfo.calcCoverageWithPrimProc(pp, fCoverageStages.begin(),
+ this->numCoverageStages());
+ fCoverageProcInfoValid = false;
+}
+
+void GrDrawState::calcColorInvariantOutput(const GrBatch* batch) const {
+ GrBatchOpt batchOpt;
+ batchOpt.fCanTweakAlphaForCoverage = this->canTweakAlphaForCoverage();
+ fColorProcInfo.calcColorWithBatch(batch, batchOpt, fColorStages.begin(),
+ this->numColorStages());
+ fColorProcInfoValid = false;
}
+void GrDrawState::calcCoverageInvariantOutput(const GrBatch* batch) const {
+ GrBatchOpt batchOpt;
+ batchOpt.fCanTweakAlphaForCoverage = this->canTweakAlphaForCoverage();
+ fCoverageProcInfo.calcCoverageWithBatch(batch, batchOpt, fCoverageStages.begin(),
+ this->numCoverageStages());
+ fCoverageProcInfoValid = false;
+}
+
+
void GrDrawState::calcColorInvariantOutput(GrColor color) const {
if (!fColorProcInfoValid || color != fColorCache) {
GrColorComponentFlags flags = kRGBA_GrColorComponentFlags;

Powered by Google App Engine
This is Rietveld 408576698