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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 void execute(GrGpu*) override; | 235 void execute(GrGpu*) override; |
236 | 236 |
237 SkAutoTUnref<State> fState; | 237 SkAutoTUnref<State> fState; |
238 SkAutoTUnref<GrBatch> fBatch; | 238 SkAutoTUnref<GrBatch> fBatch; |
239 | 239 |
240 private: | 240 private: |
241 GrBatchTarget* fBatchTarget; | 241 GrBatchTarget* fBatchTarget; |
242 }; | 242 }; |
243 | 243 |
244 struct XferBarrier : public Cmd { | 244 struct XferBarrier : public Cmd { |
245 XferBarrier() : Cmd(kXferBarrier_CmdType) {} | 245 XferBarrier(GrRenderTarget* rt) |
| 246 : Cmd(kXferBarrier_CmdType) |
| 247 , fRenderTarget(rt) { |
| 248 } |
246 | 249 |
247 void execute(GrGpu*) override; | 250 void execute(GrGpu*) override; |
248 | 251 |
249 GrXferBarrierType fBarrierType; | 252 GrXferBarrierType fBarrierType; |
| 253 |
| 254 private: |
| 255 GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> fRenderTarget; |
250 }; | 256 }; |
251 | 257 |
252 static const int kCmdBufferInitialSizeInBytes = 8 * 1024; | 258 static const int kCmdBufferInitialSizeInBytes = 8 * 1024; |
253 | 259 |
254 typedef void* TCmdAlign; // This wouldn't be enough align if a command used
long double. | 260 typedef void* TCmdAlign; // This wouldn't be enough align if a command used
long double. |
255 typedef GrTRecorder<Cmd, TCmdAlign> CmdBuffer; | 261 typedef GrTRecorder<Cmd, TCmdAlign> CmdBuffer; |
256 | 262 |
257 CmdBuffer* cmdBuffer() { return &fCmdBuffer; } | 263 CmdBuffer* cmdBuffer() { return &fCmdBuffer; } |
258 GrBatchTarget* batchTarget() { return &fBatchTarget; } | 264 GrBatchTarget* batchTarget() { return &fBatchTarget; } |
259 | 265 |
260 CmdBuffer fCmdBuffer; | 266 CmdBuffer fCmdBuffer; |
261 GrBatchTarget fBatchTarget; | 267 GrBatchTarget fBatchTarget; |
262 }; | 268 }; |
263 | 269 |
264 #endif | 270 #endif |
265 | 271 |
OLD | NEW |