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

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

Issue 1225923010: Refugee from Dead Machine 4: MDB Monster Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Last update from dead machine Created 4 years, 7 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(fFoo, 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::DrawPath::execute(GrBatchFlushState* state) {
47 if (!fState->fCompiled) {
48 state->gpu()->buildProgramDesc(&fState->fDesc, *fState->fPrimitiveProces sor,
49 *fState->getPipeline(), fState->fBatchTra cker);
50 fState->fCompiled = true;
51 }
52 GrPathRendering::DrawPathArgs args(fState->fPrimitiveProcessor.get(), fState ->getPipeline(),
53 &fState->fDesc, &fState->fBatchTracker, & fStencilSettings);
54 state->gpu()->pathRendering()->drawPath(args, this->path());
55 }
56
57 void GrTargetCommands::DrawPaths::execute(GrBatchFlushState* state) {
58 if (!fState->fCompiled) {
59 state->gpu()->buildProgramDesc(&fState->fDesc, *fState->fPrimitiveProces sor,
60 *fState->getPipeline(), fState->fBatchTra cker);
61 fState->fCompiled = true;
62 }
63 GrPathRendering::DrawPathArgs args(fState->fPrimitiveProcessor.get(), fState ->getPipeline(),
64 &fState->fDesc, &fState->fBatchTracker, & fStencilSettings);
65 state->gpu()->pathRendering()->drawPaths(args, this->pathRange(), fIndices, fIndexType,
66 fTransforms, fTransformType, fCount );
67 }
68
69 void GrTargetCommands::DrawBatch::execute(GrBatchFlushState* state) {
70 fBatch->draw(state);
71 }
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