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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 | 225 |
226 SkIPoint fDstPoint; | 226 SkIPoint fDstPoint; |
227 SkIRect fSrcRect; | 227 SkIRect fSrcRect; |
228 | 228 |
229 private: | 229 private: |
230 GrPendingIOResource<GrSurface, kWrite_GrIOType> fDst; | 230 GrPendingIOResource<GrSurface, kWrite_GrIOType> fDst; |
231 GrPendingIOResource<GrSurface, kRead_GrIOType> fSrc; | 231 GrPendingIOResource<GrSurface, kRead_GrIOType> fSrc; |
232 }; | 232 }; |
233 | 233 |
234 struct DrawBatch : public Cmd { | 234 struct DrawBatch : public Cmd { |
235 DrawBatch(GrBatch* batch, GrBatchTarget* batchTarget) | 235 DrawBatch(GrDrawBatch* 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 GrDrawBatch* batch() { return fBatch; } |
243 void execute(GrGpu*) override; | 243 void execute(GrGpu*) override; |
244 | 244 |
245 private: | 245 private: |
246 SkAutoTUnref<GrBatch> fBatch; | 246 SkAutoTUnref<GrDrawBatch> fBatch; |
247 GrBatchTarget* fBatchTarget; | 247 GrBatchTarget* fBatchTarget; |
248 }; | 248 }; |
249 | 249 |
250 static const int kCmdBufferInitialSizeInBytes = 8 * 1024; | 250 static const int kCmdBufferInitialSizeInBytes = 8 * 1024; |
251 | 251 |
252 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. |
253 typedef GrTRecorder<Cmd, TCmdAlign> CmdBuffer; | 253 typedef GrTRecorder<Cmd, TCmdAlign> CmdBuffer; |
254 | 254 |
255 CmdBuffer* cmdBuffer() { return &fCmdBuffer; } | 255 CmdBuffer* cmdBuffer() { return &fCmdBuffer; } |
256 GrBatchTarget* batchTarget() { return &fBatchTarget; } | 256 GrBatchTarget* batchTarget() { return &fBatchTarget; } |
257 | 257 |
258 CmdBuffer fCmdBuffer; | 258 CmdBuffer fCmdBuffer; |
259 GrBatchTarget fBatchTarget; | 259 GrBatchTarget fBatchTarget; |
260 }; | 260 }; |
261 | 261 |
262 #endif | 262 #endif |
263 | 263 |
OLD | NEW |