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

Unified Diff: src/gpu/GrDrawTarget.h

Issue 1278643006: Make GrBatch carry its own GrPipeline (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: more Created 5 years, 4 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/GrCommandBuilder.h ('k') | src/gpu/GrDrawTarget.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawTarget.h
diff --git a/src/gpu/GrDrawTarget.h b/src/gpu/GrDrawTarget.h
index 783f7f033730abe4a24bce7aee56214344d05c95..3c2d2b6aa31a349b1af6946fcb5e7da92a3d5c68 100644
--- a/src/gpu/GrDrawTarget.h
+++ b/src/gpu/GrDrawTarget.h
@@ -16,6 +16,7 @@
#include "GrIndexBuffer.h"
#include "GrPathRendering.h"
#include "GrPipelineBuilder.h"
+#include "GrPipeline.h"
#include "GrTraceMarker.h"
#include "GrVertexBuffer.h"
#include "GrXferProcessor.h"
@@ -33,7 +34,6 @@ class GrClip;
class GrCaps;
class GrPath;
class GrPathRange;
-class GrPipeline;
class GrDrawTarget : public SkRefCnt {
public:
@@ -200,11 +200,31 @@ public:
bool programUnitTest(GrContext* owner, int maxStages);
+ struct PipelineInfo {
+ PipelineInfo(const GrPipelineBuilder* pipelineBuilder, const GrScissorState* scissor,
+ const GrPrimitiveProcessor* primProc,
+ const SkRect* devBounds, GrDrawTarget* target);
+
+ PipelineInfo(const GrPipelineBuilder* pipelineBuilder, const GrScissorState* scissor,
+ const GrBatch* batch, const SkRect* devBounds,
+ GrDrawTarget* target);
+
+ bool valid() const { return SkToBool(fArgs.fPipelineBuilder); }
+
+ const GrPipeline::CreateArgs& pipelineCreateArgs() const {
+ SkASSERT(this->valid());
+ return fArgs;
+ }
+
+ bool willColorBlendWithDst(const GrPrimitiveProcessor* primProc) const {
+ SkASSERT(this->valid());
+ return fArgs.fPipelineBuilder->willColorBlendWithDst(primProc);
+ }
+ private:
+ GrPipeline::CreateArgs fArgs;
+ };
+
protected:
- friend class GrCommandBuilder; // for PipelineInfo
- friend class GrInOrderCommandBuilder; // for PipelineInfo
- friend class GrReorderCommandBuilder; // for PipelineInfo
- friend class GrTargetCommands; // for PipelineInfo
GrGpu* getGpu() { return fGpu; }
const GrGpu* getGpu() const { return fGpu; }
@@ -220,39 +240,12 @@ protected:
GrXferProcessor::DstTexture*,
const SkRect* drawBounds);
- struct PipelineInfo {
- PipelineInfo(const GrPipelineBuilder& pipelineBuilder, GrScissorState* scissor,
- const GrPrimitiveProcessor* primProc,
- const SkRect* devBounds, GrDrawTarget* target);
-
- PipelineInfo(const GrPipelineBuilder& pipelineBuilder, GrScissorState* scissor,
- const GrBatch* batch, const SkRect* devBounds,
- GrDrawTarget* target);
-
- bool willColorBlendWithDst(const GrPrimitiveProcessor* primProc) const {
- return fPipelineBuilder->willColorBlendWithDst(primProc);
- }
- private:
- friend class GrDrawTarget;
-
- bool mustSkipDraw() const { return (NULL == fPipelineBuilder); }
-
- const GrPipelineBuilder* fPipelineBuilder;
- GrScissorState* fScissor;
- GrProcOptInfo fColorPOI;
- GrProcOptInfo fCoveragePOI;
- GrXferProcessor::DstTexture fDstTexture;
- };
-
- const GrPipeline* setupPipeline(const PipelineInfo&, void* pipelineAddr,
- GrPipelineOptimizations*);
-
private:
virtual void onReset() = 0;
virtual void onFlush() = 0;
- virtual void onDrawBatch(GrBatch*, const PipelineInfo&) = 0;
+ virtual void onDrawBatch(GrBatch*) = 0;
virtual void onStencilPath(const GrPipelineBuilder&,
const GrPathProcessor*,
const GrPath*,
« no previous file with comments | « src/gpu/GrCommandBuilder.h ('k') | src/gpu/GrDrawTarget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698