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

Unified Diff: src/gpu/GrDrawState.h

Issue 845103005: GrBatchPrototype (Closed) Base URL: https://skia.googlesource.com/skia.git@lc2
Patch Set: update devrect 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.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;
};

Powered by Google App Engine
This is Rietveld 408576698