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

Unified Diff: src/gpu/GrPipelineBuilder.h

Issue 845103005: GrBatchPrototype (Closed) Base URL: https://skia.googlesource.com/skia.git@lc2
Patch Set: removing dstread 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
« no previous file with comments | « src/gpu/GrPipeline.cpp ('k') | src/gpu/GrPipelineBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrPipelineBuilder.h
diff --git a/src/gpu/GrPipelineBuilder.h b/src/gpu/GrPipelineBuilder.h
index 9579024d6a38453e336f78acbdc6322c79111a41..df9a1c85ee18a72777ee773982fe47e51456dac3 100644
--- a/src/gpu/GrPipelineBuilder.h
+++ b/src/gpu/GrPipelineBuilder.h
@@ -8,7 +8,7 @@
#ifndef GrPipelineBuilder_DEFINED
#define GrPipelineBuilder_DEFINED
-
+#include "GrBatch.h"
#include "GrBlend.h"
#include "GrDrawTargetCaps.h"
#include "GrGeometryProcessor.h"
@@ -391,6 +391,15 @@ public:
GrPipelineBuilder& operator= (const GrPipelineBuilder& that);
private:
+ // Calculating invariant color / coverage information is expensive, so we partially cache the
+ // results.
+ //
+ // canUseFracCoveragePrimProc() - Called in regular skia draw, caches results but only for a
+ // specific color and coverage. May be called multiple times
+ // willBlendWithDst() - only called by Nvpr, does not cache results
+ // GrOptDrawState constructor - never caches results
+
+ // TODO delete when we have Batch
const GrProcOptInfo& colorProcInfo(const GrPrimitiveProcessor* pp) const {
this->calcColorInvariantOutput(pp);
return fColorProcInfo;
@@ -401,17 +410,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
@@ -445,8 +465,6 @@ private:
mutable bool fCoverageProcInfoValid;
mutable GrColor fColorCache;
mutable GrColor fCoverageCache;
- mutable const GrPrimitiveProcessor* fColorPrimProc;
- mutable const GrPrimitiveProcessor* fCoveragePrimProc;
friend class GrPipeline;
};
« no previous file with comments | « src/gpu/GrPipeline.cpp ('k') | src/gpu/GrPipelineBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698