OLD | NEW |
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 GrTargetCommands_DEFINED | 8 #ifndef GrTargetCommands_DEFINED |
9 #define GrTargetCommands_DEFINED | 9 #define GrTargetCommands_DEFINED |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 : fCmdBuffer(kCmdBufferInitialSizeInBytes) | 28 : fCmdBuffer(kCmdBufferInitialSizeInBytes) |
29 , fBatchTarget(gpu) { | 29 , fBatchTarget(gpu) { |
30 } | 30 } |
31 | 31 |
32 class Cmd : ::SkNoncopyable { | 32 class Cmd : ::SkNoncopyable { |
33 public: | 33 public: |
34 enum CmdType { | 34 enum CmdType { |
35 kStencilPath_CmdType = 1, | 35 kStencilPath_CmdType = 1, |
36 kSetState_CmdType = 2, | 36 kSetState_CmdType = 2, |
37 kClear_CmdType = 3, | 37 kClear_CmdType = 3, |
38 kCopySurface_CmdType = 4, | 38 kClearStencil_CmdType = 4, |
39 kDrawPath_CmdType = 5, | 39 kCopySurface_CmdType = 5, |
40 kDrawPaths_CmdType = 6, | 40 kDrawPath_CmdType = 6, |
41 kDrawBatch_CmdType = 7, | 41 kDrawPaths_CmdType = 7, |
42 kXferBarrier_CmdType = 8, | 42 kDrawBatch_CmdType = 8, |
| 43 kXferBarrier_CmdType = 9, |
43 }; | 44 }; |
44 | 45 |
45 Cmd(CmdType type) : fMarkerID(-1), fType(type) {} | 46 Cmd(CmdType type) : fMarkerID(-1), fType(type) {} |
46 virtual ~Cmd() {} | 47 virtual ~Cmd() {} |
47 | 48 |
48 virtual void execute(GrGpu*) = 0; | 49 virtual void execute(GrGpu*) = 0; |
49 | 50 |
50 CmdType type() const { return fType; } | 51 CmdType type() const { return fType; } |
51 | 52 |
52 // trace markers | 53 // trace markers |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 SkIRect fRect; | 184 SkIRect fRect; |
184 GrColor fColor; | 185 GrColor fColor; |
185 bool fCanIgnoreRect; | 186 bool fCanIgnoreRect; |
186 | 187 |
187 private: | 188 private: |
188 GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> fRenderTarget; | 189 GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> fRenderTarget; |
189 }; | 190 }; |
190 | 191 |
191 // This command is ONLY used by the clip mask manager to clear the stencil c
lip bits | 192 // This command is ONLY used by the clip mask manager to clear the stencil c
lip bits |
192 struct ClearStencilClip : public Cmd { | 193 struct ClearStencilClip : public Cmd { |
193 ClearStencilClip(GrRenderTarget* rt) : Cmd(kClear_CmdType), fRenderTarge
t(rt) {} | 194 ClearStencilClip(GrRenderTarget* rt) : Cmd(kClearStencil_CmdType), fRend
erTarget(rt) {} |
194 | 195 |
195 GrRenderTarget* renderTarget() const { return fRenderTarget.get(); } | 196 GrRenderTarget* renderTarget() const { return fRenderTarget.get(); } |
196 | 197 |
197 void execute(GrGpu*) override; | 198 void execute(GrGpu*) override; |
198 | 199 |
199 SkIRect fRect; | 200 SkIRect fRect; |
200 bool fInsideClip; | 201 bool fInsideClip; |
201 | 202 |
202 private: | 203 private: |
203 GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> fRenderTarget; | 204 GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> fRenderTarget; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 | 263 |
263 CmdBuffer* cmdBuffer() { return &fCmdBuffer; } | 264 CmdBuffer* cmdBuffer() { return &fCmdBuffer; } |
264 GrBatchTarget* batchTarget() { return &fBatchTarget; } | 265 GrBatchTarget* batchTarget() { return &fBatchTarget; } |
265 | 266 |
266 CmdBuffer fCmdBuffer; | 267 CmdBuffer fCmdBuffer; |
267 GrBatchTarget fBatchTarget; | 268 GrBatchTarget fBatchTarget; |
268 }; | 269 }; |
269 | 270 |
270 #endif | 271 #endif |
271 | 272 |
OLD | NEW |