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

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

Issue 1315513008: Cleanup GrDrawTarget now that all paths lead to GrBatch (Closed) Base URL: https://skia.googlesource.com/skia.git@patharray
Patch Set: remove change to SampleApp.cpp Created 5 years, 3 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/GrTargetCommands.h ('k') | src/gpu/GrTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #include "GrTargetCommands.h"
9
10 #include "GrBatchFlushState.h"
11 #include "GrGpu.h"
12 #include "GrPathRendering.h"
13 #include "batches/GrDrawBatch.h"
14 #include "batches/GrVertexBatch.h"
15
16 GrBATCH_SPEW(int32_t GrTargetCommands::Cmd::gUniqueID = 0;)
17
18 void GrTargetCommands::reset() {
19 fCmdBuffer.reset();
20 }
21
22 void GrTargetCommands::flush(GrGpu* gpu, GrResourceProvider* resourceProvider) {
23 GrBATCH_INFO("Flushing\n");
24 if (fCmdBuffer.empty()) {
25 return;
26 }
27 GrBatchFlushState flushState(gpu, resourceProvider, fLastFlushToken);
28 // Loop over all batches and generate geometry
29 CmdBuffer::Iter genIter(fCmdBuffer);
30 while (genIter.next()) {
31 if (Cmd::kDrawBatch_CmdType == genIter->type()) {
32 DrawBatch* db = reinterpret_cast<DrawBatch*>(genIter.get());
33 db->batch()->prepare(&flushState);
34 }
35 }
36
37 flushState.preIssueDraws();
38
39 CmdBuffer::Iter iter(fCmdBuffer);
40 while (iter.next()) {
41 iter->execute(&flushState);
42 }
43 fLastFlushToken = flushState.lastFlushedToken();
44 }
45
46 void GrTargetCommands::DrawBatch::execute(GrBatchFlushState* state) {
47 fBatch->draw(state);
48 }
OLDNEW
« no previous file with comments | « src/gpu/GrTargetCommands.h ('k') | src/gpu/GrTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698