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

Unified Diff: src/gpu/GrCommandBuilder.h

Issue 1113313003: Create GrCommandBuilder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: cleanup Created 5 years, 7 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 | « gyp/gpu.gypi ('k') | src/gpu/GrCommandBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrCommandBuilder.h
diff --git a/src/gpu/GrCommandBuilder.h b/src/gpu/GrCommandBuilder.h
new file mode 100644
index 0000000000000000000000000000000000000000..165c2c203555ebf540408750dc3309bf0416bc4c
--- /dev/null
+++ b/src/gpu/GrCommandBuilder.h
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef GrCommandBuilder_DEFINED
+#define GrCommandBuilder_DEFINED
+
+#include "GrTargetCommands.h"
+
+class GrInOrderDrawBuffer;
+class GrVertexBufferAllocPool;
+class GrIndexBufferAllocPool;
+
+class GrCommandBuilder : ::SkNoncopyable {
+public:
+ typedef GrTargetCommands::Cmd Cmd;
+ typedef GrTargetCommands::State State;
+
+ GrCommandBuilder(GrGpu* gpu,
+ GrVertexBufferAllocPool* vertexPool,
+ GrIndexBufferAllocPool* indexPool)
+ : fCommands(gpu, vertexPool, indexPool) {
+ }
+
+ virtual ~GrCommandBuilder() {}
+
+ void reset() { fCommands.reset(); }
+ void flush(GrInOrderDrawBuffer* iodb) { fCommands.flush(iodb); }
+
+ virtual Cmd* recordClearStencilClip(const SkIRect& rect,
+ bool insideClip,
+ GrRenderTarget* renderTarget);
+ virtual Cmd* recordDiscard(GrRenderTarget*);
+ virtual Cmd* recordDrawBatch(State*, GrBatch*);
+ virtual Cmd* recordStencilPath(const GrPipelineBuilder&,
+ const GrPathProcessor*,
+ const GrPath*,
+ const GrScissorState&,
+ const GrStencilSettings&);
+ virtual Cmd* recordDrawPath(State*,
+ const GrPathProcessor*,
+ const GrPath*,
+ const GrStencilSettings&);
+ virtual Cmd* recordDrawPaths(State*,
+ GrInOrderDrawBuffer*,
+ const GrPathProcessor*,
+ const GrPathRange*,
+ const void*,
+ GrDrawTarget::PathIndexType,
+ const float transformValues[],
+ GrDrawTarget::PathTransformType ,
+ int,
+ const GrStencilSettings&,
+ const GrDrawTarget::PipelineInfo&);
+ virtual Cmd* recordClear(const SkIRect* rect,
+ GrColor,
+ bool canIgnoreRect,
+ GrRenderTarget*);
+ virtual Cmd* recordCopySurface(GrSurface* dst,
+ GrSurface* src,
+ const SkIRect& srcRect,
+ const SkIPoint& dstPoint);
+ virtual Cmd* recordXferBarrierIfNecessary(const GrPipeline&, const GrDrawTargetCaps&);
+
+private:
+ typedef GrTargetCommands::DrawBatch DrawBatch;
+ typedef GrTargetCommands::StencilPath StencilPath;
+ typedef GrTargetCommands::DrawPath DrawPath;
+ typedef GrTargetCommands::DrawPaths DrawPaths;
+ typedef GrTargetCommands::Clear Clear;
+ typedef GrTargetCommands::ClearStencilClip ClearStencilClip;
+ typedef GrTargetCommands::CopySurface CopySurface;
+ typedef GrTargetCommands::XferBarrier XferBarrier;
+
+ GrTargetCommands::CmdBuffer* cmdBuffer() { return fCommands.cmdBuffer(); }
+ GrBatchTarget* batchTarget() { return fCommands.batchTarget(); }
+
+ GrTargetCommands fCommands;
+
+};
+
+#endif
« no previous file with comments | « gyp/gpu.gypi ('k') | src/gpu/GrCommandBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698