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 #include "GrTargetCommands.h" | 8 #include "GrTargetCommands.h" |
9 | 9 |
10 #include "GrBatchFlushState.h" | 10 #include "GrBatchFlushState.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 | 36 |
37 flushState.preIssueDraws(); | 37 flushState.preIssueDraws(); |
38 | 38 |
39 CmdBuffer::Iter iter(fCmdBuffer); | 39 CmdBuffer::Iter iter(fCmdBuffer); |
40 while (iter.next()) { | 40 while (iter.next()) { |
41 iter->execute(&flushState); | 41 iter->execute(&flushState); |
42 } | 42 } |
43 fLastFlushToken = flushState.lastFlushedToken(); | 43 fLastFlushToken = flushState.lastFlushedToken(); |
44 } | 44 } |
45 | 45 |
46 void GrTargetCommands::StencilPath::execute(GrBatchFlushState* state) { | |
47 GrPathRendering::StencilPathArgs args(fUseHWAA, fRenderTarget.get(), &fViewM
atrix, &fScissor, | |
48 &fStencil); | |
49 state->gpu()->pathRendering()->stencilPath(args, this->path()); | |
50 } | |
51 | |
52 void GrTargetCommands::DrawPath::execute(GrBatchFlushState* state) { | 46 void GrTargetCommands::DrawPath::execute(GrBatchFlushState* state) { |
53 if (!fState->fCompiled) { | 47 if (!fState->fCompiled) { |
54 state->gpu()->buildProgramDesc(&fState->fDesc, *fState->fPrimitiveProces
sor, | 48 state->gpu()->buildProgramDesc(&fState->fDesc, *fState->fPrimitiveProces
sor, |
55 *fState->getPipeline(), fState->fBatchTra
cker); | 49 *fState->getPipeline(), fState->fBatchTra
cker); |
56 fState->fCompiled = true; | 50 fState->fCompiled = true; |
57 } | 51 } |
58 GrPathRendering::DrawPathArgs args(fState->fPrimitiveProcessor.get(), fState
->getPipeline(), | 52 GrPathRendering::DrawPathArgs args(fState->fPrimitiveProcessor.get(), fState
->getPipeline(), |
59 &fState->fDesc, &fState->fBatchTracker, &
fStencilSettings); | 53 &fState->fDesc, &fState->fBatchTracker, &
fStencilSettings); |
60 state->gpu()->pathRendering()->drawPath(args, this->path()); | 54 state->gpu()->pathRendering()->drawPath(args, this->path()); |
61 } | 55 } |
62 | 56 |
63 void GrTargetCommands::DrawPaths::execute(GrBatchFlushState* state) { | 57 void GrTargetCommands::DrawPaths::execute(GrBatchFlushState* state) { |
64 if (!fState->fCompiled) { | 58 if (!fState->fCompiled) { |
65 state->gpu()->buildProgramDesc(&fState->fDesc, *fState->fPrimitiveProces
sor, | 59 state->gpu()->buildProgramDesc(&fState->fDesc, *fState->fPrimitiveProces
sor, |
66 *fState->getPipeline(), fState->fBatchTra
cker); | 60 *fState->getPipeline(), fState->fBatchTra
cker); |
67 fState->fCompiled = true; | 61 fState->fCompiled = true; |
68 } | 62 } |
69 GrPathRendering::DrawPathArgs args(fState->fPrimitiveProcessor.get(), fState
->getPipeline(), | 63 GrPathRendering::DrawPathArgs args(fState->fPrimitiveProcessor.get(), fState
->getPipeline(), |
70 &fState->fDesc, &fState->fBatchTracker, &
fStencilSettings); | 64 &fState->fDesc, &fState->fBatchTracker, &
fStencilSettings); |
71 state->gpu()->pathRendering()->drawPaths(args, this->pathRange(), fIndices,
fIndexType, | 65 state->gpu()->pathRendering()->drawPaths(args, this->pathRange(), fIndices,
fIndexType, |
72 fTransforms, fTransformType, fCount
); | 66 fTransforms, fTransformType, fCount
); |
73 } | 67 } |
74 | 68 |
75 void GrTargetCommands::DrawBatch::execute(GrBatchFlushState* state) { | 69 void GrTargetCommands::DrawBatch::execute(GrBatchFlushState* state) { |
76 fBatch->draw(state); | 70 fBatch->draw(state); |
77 } | 71 } |
OLD | NEW |