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

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

Issue 1293583002: Introduce GrBatch subclasses GrDrawBatch and GrVertexBatch to prepare for non-drawing batches (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove duplicated fields in GrVertexBatch 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/GrReorderCommandBuilder.cpp ('k') | src/gpu/GrTargetCommands.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 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
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
OLDNEW
« no previous file with comments | « src/gpu/GrReorderCommandBuilder.cpp ('k') | src/gpu/GrTargetCommands.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698