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 "GrImmediateDrawTarget.h" | 8 #include "GrImmediateDrawTarget.h" |
9 | 9 |
10 #include "GrBatch.h" | 10 #include "GrBatch.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 void GrImmediateDrawTarget::onDrawBatch(GrBatch* batch, | 27 void GrImmediateDrawTarget::onDrawBatch(GrBatch* batch, |
28 const PipelineInfo& pipelineInfo) { | 28 const PipelineInfo& pipelineInfo) { |
29 SkAlignedSStorage<sizeof(GrPipeline)> pipelineStorage; | 29 SkAlignedSStorage<sizeof(GrPipeline)> pipelineStorage; |
30 GrPipeline* pipeline = reinterpret_cast<GrPipeline*>(pipelineStorage.get()); | 30 GrPipeline* pipeline = reinterpret_cast<GrPipeline*>(pipelineStorage.get()); |
31 if (!this->setupPipelineAndShouldDraw(pipeline, pipelineInfo)) { | 31 if (!this->setupPipelineAndShouldDraw(pipeline, pipelineInfo)) { |
32 pipeline->~GrPipeline(); | 32 pipeline->~GrPipeline(); |
33 return; | 33 return; |
34 } | 34 } |
35 | 35 |
36 batch->initBatchTracker(pipeline->infoForPrimitiveProcessor()); | 36 batch->initBatchTracker(pipeline->getInitBatchTracker()); |
37 | 37 |
38 fBatchTarget.resetNumberOfDraws(); | 38 fBatchTarget.resetNumberOfDraws(); |
39 | 39 |
40 batch->generateGeometry(&fBatchTarget, pipeline); | 40 batch->generateGeometry(&fBatchTarget, pipeline); |
41 batch->setNumberOfDraws(fBatchTarget.numberOfDraws()); | 41 batch->setNumberOfDraws(fBatchTarget.numberOfDraws()); |
42 | 42 |
43 fBatchTarget.preFlush(); | 43 fBatchTarget.preFlush(); |
44 fBatchTarget.flushNext(batch->numberOfDraws()); | 44 fBatchTarget.flushNext(batch->numberOfDraws()); |
45 fBatchTarget.postFlush(); | 45 fBatchTarget.postFlush(); |
46 | 46 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 | 89 |
90 void GrImmediateDrawTarget::recordXferBarrierIfNecessary(const GrPipeline* pipel
ine) { | 90 void GrImmediateDrawTarget::recordXferBarrierIfNecessary(const GrPipeline* pipel
ine) { |
91 const GrXferProcessor& xp = *pipeline->getXferProcessor(); | 91 const GrXferProcessor& xp = *pipeline->getXferProcessor(); |
92 GrRenderTarget* rt = pipeline->getRenderTarget(); | 92 GrRenderTarget* rt = pipeline->getRenderTarget(); |
93 | 93 |
94 GrXferBarrierType barrierType; | 94 GrXferBarrierType barrierType; |
95 if (xp.willNeedXferBarrier(rt, *this->caps(), &barrierType)) { | 95 if (xp.willNeedXferBarrier(rt, *this->caps(), &barrierType)) { |
96 this->getGpu()->xferBarrier(rt, barrierType); | 96 this->getGpu()->xferBarrier(rt, barrierType); |
97 } | 97 } |
98 } | 98 } |
OLD | NEW |