| 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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 struct DrawBatch : public Cmd { | 234 struct DrawBatch : public Cmd { |
| 235 DrawBatch(GrBatch* batch, GrBatchTarget* batchTarget) | 235 DrawBatch(GrBatch* batch, GrBatchTarget* batchTarget) |
| 236 : Cmd(kDrawBatch_CmdType) | 236 : Cmd(kDrawBatch_CmdType) |
| 237 , fBatch(SkRef(batch)) | 237 , fBatch(SkRef(batch)) |
| 238 , fBatchTarget(batchTarget) { | 238 , fBatchTarget(batchTarget) { |
| 239 SkASSERT(!batch->isUsed()); | 239 SkASSERT(!batch->isUsed()); |
| 240 } | 240 } |
| 241 | 241 |
| 242 GrBatch* batch() { return fBatch; } | 242 GrBatch* batch() { return fBatch; } |
| 243 void execute(GrGpu*) override; | 243 void execute(GrGpu*) override; |
| 244 |
| 244 private: | 245 private: |
| 245 SkAutoTUnref<GrBatch> fBatch; | 246 SkAutoTUnref<GrBatch> fBatch; |
| 246 GrBatchTarget* fBatchTarget; | 247 GrBatchTarget* fBatchTarget; |
| 247 }; | 248 }; |
| 248 | 249 |
| 249 static const int kCmdBufferInitialSizeInBytes = 8 * 1024; | 250 static const int kCmdBufferInitialSizeInBytes = 8 * 1024; |
| 250 | 251 |
| 251 typedef void* TCmdAlign; // This wouldn't be enough align if a command used
long double. | 252 typedef void* TCmdAlign; // This wouldn't be enough align if a command used
long double. |
| 252 typedef GrTRecorder<Cmd, TCmdAlign> CmdBuffer; | 253 typedef GrTRecorder<Cmd, TCmdAlign> CmdBuffer; |
| 253 | 254 |
| 254 CmdBuffer* cmdBuffer() { return &fCmdBuffer; } | 255 CmdBuffer* cmdBuffer() { return &fCmdBuffer; } |
| 255 GrBatchTarget* batchTarget() { return &fBatchTarget; } | 256 GrBatchTarget* batchTarget() { return &fBatchTarget; } |
| 256 | 257 |
| 257 CmdBuffer fCmdBuffer; | 258 CmdBuffer fCmdBuffer; |
| 258 GrBatchTarget fBatchTarget; | 259 GrBatchTarget fBatchTarget; |
| 259 }; | 260 }; |
| 260 | 261 |
| 261 #endif | 262 #endif |
| 262 | 263 |
| OLD | NEW |