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 "GrGpu.h" | 10 #include "GrGpu.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 GrPipelineOptimizations opts; | 30 GrPipelineOptimizations opts; |
31 SkAlignedSStorage<sizeof(GrPipeline)> pipelineStorage; | 31 SkAlignedSStorage<sizeof(GrPipeline)> pipelineStorage; |
32 bool shouldDraw = this->setupPipelineAndShouldDraw(pipelineStorage.get(), pi
pelineInfo, &opts); | 32 bool shouldDraw = this->setupPipelineAndShouldDraw(pipelineStorage.get(), pi
pelineInfo, &opts); |
33 GrPipeline* pipeline = reinterpret_cast<GrPipeline*>(pipelineStorage.get()); | 33 GrPipeline* pipeline = reinterpret_cast<GrPipeline*>(pipelineStorage.get()); |
34 | 34 |
35 if (!shouldDraw) { | 35 if (!shouldDraw) { |
36 pipeline->~GrPipeline(); | 36 pipeline->~GrPipeline(); |
37 return; | 37 return; |
38 } | 38 } |
39 | 39 |
40 batch->initBatchTracker(opts); | |
41 | |
42 fBatchTarget.resetNumberOfDraws(); | 40 fBatchTarget.resetNumberOfDraws(); |
43 | 41 |
44 batch->generateGeometry(&fBatchTarget); | 42 batch->generateGeometry(&fBatchTarget); |
45 batch->setNumberOfDraws(fBatchTarget.numberOfDraws()); | 43 batch->setNumberOfDraws(fBatchTarget.numberOfDraws()); |
46 | 44 |
47 fBatchTarget.preFlush(); | 45 fBatchTarget.preFlush(); |
48 fBatchTarget.flushNext(batch->numberOfDraws()); | 46 fBatchTarget.flushNext(batch->numberOfDraws()); |
49 fBatchTarget.postFlush(); | 47 fBatchTarget.postFlush(); |
50 | 48 |
51 pipeline->~GrPipeline(); | 49 pipeline->~GrPipeline(); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 | 99 |
102 void GrImmediateDrawTarget::recordXferBarrierIfNecessary(const GrPipeline* pipel
ine) { | 100 void GrImmediateDrawTarget::recordXferBarrierIfNecessary(const GrPipeline* pipel
ine) { |
103 const GrXferProcessor& xp = *pipeline->getXferProcessor(); | 101 const GrXferProcessor& xp = *pipeline->getXferProcessor(); |
104 GrRenderTarget* rt = pipeline->getRenderTarget(); | 102 GrRenderTarget* rt = pipeline->getRenderTarget(); |
105 | 103 |
106 GrXferBarrierType barrierType; | 104 GrXferBarrierType barrierType; |
107 if (xp.willNeedXferBarrier(rt, *this->caps(), &barrierType)) { | 105 if (xp.willNeedXferBarrier(rt, *this->caps(), &barrierType)) { |
108 this->getGpu()->xferBarrier(rt, barrierType); | 106 this->getGpu()->xferBarrier(rt, barrierType); |
109 } | 107 } |
110 } | 108 } |
OLD | NEW |