Index: src/gpu/GrDrawState.cpp |
diff --git a/src/gpu/GrDrawState.cpp b/src/gpu/GrDrawState.cpp |
index 4ec39e7005a327d5470fafebfd40c61efa209f6d..f3a1b45cd942110d2367bc65ca58061b3793dafe 100644 |
--- a/src/gpu/GrDrawState.cpp |
+++ b/src/gpu/GrDrawState.cpp |
@@ -59,6 +59,8 @@ GrDrawState& GrDrawState::operator=(const GrDrawState& that) { |
fCoverageCache = that.fCoverageCache; |
fColorPrimProc = that.fColorPrimProc; |
fCoveragePrimProc = that.fCoveragePrimProc; |
+ fColorBatch = that.fColorBatch; |
+ fCoverageBatch = that.fCoverageBatch; |
if (fColorProcInfoValid) { |
fColorProcInfo = that.fColorProcInfo; |
} |
@@ -88,6 +90,9 @@ void GrDrawState::onReset() { |
fColorPrimProc = NULL; |
fCoveragePrimProc = NULL; |
+ |
+ fColorBatch = NULL; |
+ fCoverageBatch = NULL; |
} |
void GrDrawState::setFromPaint(const GrPaint& paint, GrRenderTarget* rt) { |
@@ -127,6 +132,9 @@ void GrDrawState::setFromPaint(const GrPaint& paint, GrRenderTarget* rt) { |
fColorPrimProc = NULL; |
fCoveragePrimProc = NULL; |
+ |
+ fColorBatch = NULL; |
+ fCoverageBatch = NULL; |
} |
//////////////////////////////////////////////////////////////////////////////// |
@@ -216,6 +224,29 @@ void GrDrawState::calcCoverageInvariantOutput(const GrPrimitiveProcessor* pp) co |
} |
} |
+void GrDrawState::calcColorInvariantOutput(const GrBatch* batch) const { |
+ if (!fColorProcInfoValid || fColorBatch != batch) { |
+ GrBatchOpt batchOpt; |
+ batchOpt.fCanTweakAlphaForCoverage = this->canTweakAlphaForCoverage(); |
+ fColorProcInfo.calcColorWithBatch(batch, batchOpt, fColorStages.begin(), |
+ this->numColorStages()); |
+ fColorProcInfoValid = true; |
+ fColorBatch = batch; |
+ } |
+} |
+ |
+void GrDrawState::calcCoverageInvariantOutput(const GrBatch* batch) const { |
+ if (!fCoverageProcInfoValid || fCoverageBatch != batch) { |
+ GrBatchOpt batchOpt; |
+ batchOpt.fCanTweakAlphaForCoverage = this->canTweakAlphaForCoverage(); |
+ fCoverageProcInfo.calcCoverageWithBatch(batch, batchOpt, fCoverageStages.begin(), |
+ this->numCoverageStages()); |
+ fCoverageProcInfoValid = true; |
+ fCoverageBatch = batch; |
+ } |
+} |
+ |
+ |
void GrDrawState::calcColorInvariantOutput(GrColor color) const { |
if (!fColorProcInfoValid || color != fColorCache) { |
GrColorComponentFlags flags = kRGBA_GrColorComponentFlags; |