Index: src/gpu/GrDrawState.h |
diff --git a/src/gpu/GrDrawState.h b/src/gpu/GrDrawState.h |
index c02429f9658f7aa624923058bf2b44ff4a260373..4af851bbdab7fdad30b325044de05c454fdf8115 100644 |
--- a/src/gpu/GrDrawState.h |
+++ b/src/gpu/GrDrawState.h |
@@ -8,7 +8,7 @@ |
#ifndef GrDrawState_DEFINED |
#define GrDrawState_DEFINED |
- |
+#include "GrBatch.h" |
#include "GrBlend.h" |
#include "GrDrawTargetCaps.h" |
#include "GrGeometryProcessor.h" |
@@ -406,6 +406,7 @@ public: |
private: |
bool isEqual(const GrDrawState& that, bool explicitLocalCoords) const; |
+ // TODO delete when we have Batch |
const GrProcOptInfo& colorProcInfo(const GrPrimitiveProcessor* pp) const { |
this->calcColorInvariantOutput(pp); |
return fColorProcInfo; |
@@ -416,17 +417,28 @@ private: |
return fCoverageProcInfo; |
} |
+ const GrProcOptInfo& colorProcInfo(const GrBatch* batch) const { |
+ this->calcColorInvariantOutput(batch); |
+ return fColorProcInfo; |
+ } |
+ |
+ const GrProcOptInfo& coverageProcInfo(const GrBatch* batch) const { |
+ this->calcCoverageInvariantOutput(batch); |
+ return fCoverageProcInfo; |
+ } |
+ |
/** |
- * If fColorProcInfoValid is false, function calculates the invariant output for the color |
- * stages and results are stored in fColorProcInfo. |
+ * Primproc variants of the calc functions |
+ * TODO remove these when batch is everywhere |
*/ |
void calcColorInvariantOutput(const GrPrimitiveProcessor*) const; |
+ void calcCoverageInvariantOutput(const GrPrimitiveProcessor*) const; |
/** |
- * If fCoverageProcInfoValid is false, function calculates the invariant output for the coverage |
- * stages and results are stored in fCoverageProcInfo. |
+ * GrBatch provides the initial seed for these loops based off of its initial geometry data |
*/ |
- void calcCoverageInvariantOutput(const GrPrimitiveProcessor*) const; |
+ void calcColorInvariantOutput(const GrBatch*) const; |
+ void calcCoverageInvariantOutput(const GrBatch*) const; |
/** |
* If fColorProcInfoValid is false, function calculates the invariant output for the color |
@@ -462,8 +474,13 @@ private: |
mutable bool fCoverageProcInfoValid; |
mutable GrColor fColorCache; |
mutable GrColor fCoverageCache; |
+ // TODO delete when batch is everywhere |
mutable const GrPrimitiveProcessor* fColorPrimProc; |
mutable const GrPrimitiveProcessor* fCoveragePrimProc; |
+ // These oddly named parameters are used by the Calc*InvariantOutput calls to determine if they |
+ // need to recalculate optimization information. They are just pointer caches for the two loops |
+ mutable const GrBatch* fColorBatch; |
+ mutable const GrBatch* fCoverageBatch; |
friend class GrOptDrawState; |
}; |