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

Side by Side Diff: src/gpu/GrCommandBuilder.h

Issue 1286043004: Make GrVertexBatch objects hold their own draws during GrDrawTarget flush (Closed) Base URL: https://skia.googlesource.com/skia.git@m
Patch Set: forward decl 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 unified diff | Download patch
« no previous file with comments | « src/gpu/GrBufferedDrawTarget.cpp ('k') | src/gpu/GrCommandBuilder.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef GrCommandBuilder_DEFINED 8 #ifndef GrCommandBuilder_DEFINED
9 #define GrCommandBuilder_DEFINED 9 #define GrCommandBuilder_DEFINED
10 10
11 #include "GrTargetCommands.h" 11 #include "GrTargetCommands.h"
12 12
13 class GrGpu;
14 class GrResourceProvider;
13 class GrBufferedDrawTarget; 15 class GrBufferedDrawTarget;
14 16
15 class GrCommandBuilder : ::SkNoncopyable { 17 class GrCommandBuilder : ::SkNoncopyable {
16 public: 18 public:
17 typedef GrTargetCommands::Cmd Cmd; 19 typedef GrTargetCommands::Cmd Cmd;
18 typedef GrTargetCommands::StateForPathDraw State; 20 typedef GrTargetCommands::StateForPathDraw State;
19 21
20 static GrCommandBuilder* Create(GrGpu* gpu, bool reorder); 22 static GrCommandBuilder* Create(GrGpu* gpu, bool reorder);
21 23
22 virtual ~GrCommandBuilder() {} 24 virtual ~GrCommandBuilder() {}
23 25
24 void reset() { fCommands.reset(); } 26 void reset() { fCommands.reset(); }
25 void flush(GrBufferedDrawTarget* bufferedDrawTarget) { fCommands.flush(buffe redDrawTarget); } 27 void flush(GrGpu* gpu, GrResourceProvider* rp) { fCommands.flush(gpu, rp); }
26 28
27 virtual Cmd* recordClearStencilClip(const SkIRect& rect, 29 virtual Cmd* recordClearStencilClip(const SkIRect& rect,
28 bool insideClip, 30 bool insideClip,
29 GrRenderTarget* renderTarget); 31 GrRenderTarget* renderTarget);
30 virtual Cmd* recordDiscard(GrRenderTarget*); 32 virtual Cmd* recordDiscard(GrRenderTarget*);
31 virtual Cmd* recordDrawBatch(GrDrawBatch*, const GrCaps&) = 0; 33 virtual Cmd* recordDrawBatch(GrDrawBatch*, const GrCaps&) = 0;
32 virtual Cmd* recordStencilPath(const GrPipelineBuilder&, 34 virtual Cmd* recordStencilPath(const GrPipelineBuilder&,
33 const GrPathProcessor*, 35 const GrPathProcessor*,
34 const GrPath*, 36 const GrPath*,
35 const GrScissorState&, 37 const GrScissorState&,
(...skipping 23 matching lines...) Expand all
59 61
60 protected: 62 protected:
61 typedef GrTargetCommands::DrawBatch DrawBatch; 63 typedef GrTargetCommands::DrawBatch DrawBatch;
62 typedef GrTargetCommands::StencilPath StencilPath; 64 typedef GrTargetCommands::StencilPath StencilPath;
63 typedef GrTargetCommands::DrawPath DrawPath; 65 typedef GrTargetCommands::DrawPath DrawPath;
64 typedef GrTargetCommands::DrawPaths DrawPaths; 66 typedef GrTargetCommands::DrawPaths DrawPaths;
65 typedef GrTargetCommands::Clear Clear; 67 typedef GrTargetCommands::Clear Clear;
66 typedef GrTargetCommands::ClearStencilClip ClearStencilClip; 68 typedef GrTargetCommands::ClearStencilClip ClearStencilClip;
67 typedef GrTargetCommands::CopySurface CopySurface; 69 typedef GrTargetCommands::CopySurface CopySurface;
68 70
69 GrCommandBuilder(GrGpu* gpu) : fCommands(gpu) {} 71 GrCommandBuilder() {}
70 72
71 GrTargetCommands::CmdBuffer* cmdBuffer() { return fCommands.cmdBuffer(); } 73 GrTargetCommands::CmdBuffer* cmdBuffer() { return fCommands.cmdBuffer(); }
72 GrBatchTarget* batchTarget() { return fCommands.batchTarget(); }
73
74 private: 74 private:
75 GrTargetCommands fCommands; 75 GrTargetCommands fCommands;
76 76
77 }; 77 };
78 78
79 #endif 79 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrBufferedDrawTarget.cpp ('k') | src/gpu/GrCommandBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698