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

Unified Diff: src/gpu/GrTargetCommands.h

Issue 1315563003: GrPathRangeBatch (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix init order warning Created 5 years, 3 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/GrStencilAndCoverTextContext.cpp ('k') | src/gpu/GrTargetCommands.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrTargetCommands.h
diff --git a/src/gpu/GrTargetCommands.h b/src/gpu/GrTargetCommands.h
index 4f804c31b913aa7590cd7e44bb6c9e89aeb73fe9..5d9cdfc5be8ce30d3c9ec94651ab7f298f2728cf 100644
--- a/src/gpu/GrTargetCommands.h
+++ b/src/gpu/GrTargetCommands.h
@@ -30,8 +30,6 @@ public:
class Cmd : ::SkNoncopyable {
public:
enum CmdType {
- kDrawPath_CmdType = 2,
- kDrawPaths_CmdType = 3,
kDrawBatch_CmdType = 4,
};
@@ -73,88 +71,6 @@ private:
typedef GrGpu::DrawArgs DrawArgs;
- // TODO: This can be just a pipeline once paths are in batch, and it should live elsewhere
- struct StateForPathDraw : public SkNVRefCnt<StateForPathDraw> {
- // TODO get rid of the prim proc parameter when we use batch everywhere
- StateForPathDraw(const GrPrimitiveProcessor* primProc = nullptr)
- : fPrimitiveProcessor(primProc)
- , fCompiled(false) {}
-
- ~StateForPathDraw() { reinterpret_cast<GrPipeline*>(fPipeline.get())->~GrPipeline(); }
-
- // This function is only for getting the location in memory where we will create our
- // pipeline object.
- void* pipelineLocation() { return fPipeline.get(); }
-
- const GrPipeline* getPipeline() const {
- return reinterpret_cast<const GrPipeline*>(fPipeline.get());
- }
- GrRenderTarget* getRenderTarget() const {
- return this->getPipeline()->getRenderTarget();
- }
- const GrXferProcessor* getXferProcessor() const {
- return this->getPipeline()->getXferProcessor();
- }
-
- void operator delete(void* p) {}
- void* operator new(size_t) {
- SkFAIL("All States are created by placement new.");
- return sk_malloc_throw(0);
- }
-
- void* operator new(size_t, void* p) { return p; }
- void operator delete(void* target, void* placement) {
- ::operator delete(target, placement);
- }
-
- typedef GrPendingProgramElement<const GrPrimitiveProcessor> ProgramPrimitiveProcessor;
- ProgramPrimitiveProcessor fPrimitiveProcessor;
- SkAlignedSStorage<sizeof(GrPipeline)> fPipeline;
- GrProgramDesc fDesc;
- GrBatchTracker fBatchTracker;
- bool fCompiled;
- };
- // TODO remove this when State is just a pipeline
- friend SkNVRefCnt<StateForPathDraw>;
-
- struct DrawPath : public Cmd {
- DrawPath(StateForPathDraw* state, const GrPath* path)
- : Cmd(kDrawPath_CmdType)
- , fState(SkRef(state))
- , fPath(path) {}
-
- const GrPath* path() const { return fPath.get(); }
-
- void execute(GrBatchFlushState*) override;
-
- SkAutoTUnref<StateForPathDraw> fState;
- GrStencilSettings fStencilSettings;
- private:
- GrPendingIOResource<const GrPath, kRead_GrIOType> fPath;
- };
-
- struct DrawPaths : public Cmd {
- DrawPaths(StateForPathDraw* state, const GrPathRange* pathRange)
- : Cmd(kDrawPaths_CmdType)
- , fState(SkRef(state))
- , fPathRange(pathRange) {}
-
- const GrPathRange* pathRange() const { return fPathRange.get(); }
-
- void execute(GrBatchFlushState*) override;
-
- SkAutoTUnref<StateForPathDraw> fState;
- char* fIndices;
- GrDrawTarget::PathIndexType fIndexType;
- float* fTransforms;
- GrDrawTarget::PathTransformType fTransformType;
- int fCount;
- GrStencilSettings fStencilSettings;
-
- private:
- GrPendingIOResource<const GrPathRange, kRead_GrIOType> fPathRange;
- };
-
struct DrawBatch : public Cmd {
DrawBatch(GrBatch* batch)
: Cmd(kDrawBatch_CmdType)
« no previous file with comments | « src/gpu/GrStencilAndCoverTextContext.cpp ('k') | src/gpu/GrTargetCommands.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698