| 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::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) { | 46 void GrTargetCommands::DrawBatch::execute(GrBatchFlushState* state) { |
| 70 fBatch->draw(state); | 47 fBatch->draw(state); |
| 71 } | 48 } |
| OLD | NEW |