Chromium Code Reviews| Index: src/gpu/GrImmediateDrawTarget.cpp |
| diff --git a/src/gpu/GrImmediateDrawTarget.cpp b/src/gpu/GrImmediateDrawTarget.cpp |
| index 0c4210ad705280cb94dbc4f1c2ce49ed825f485b..926cba11b81633a5410a739b9b9819abf43a2d60 100644 |
| --- a/src/gpu/GrImmediateDrawTarget.cpp |
| +++ b/src/gpu/GrImmediateDrawTarget.cpp |
| @@ -27,8 +27,10 @@ GrImmediateDrawTarget::~GrImmediateDrawTarget() { |
| void GrImmediateDrawTarget::onDrawBatch(GrBatch* batch, |
| const PipelineInfo& pipelineInfo) { |
| SkAlignedSStorage<sizeof(GrPipeline)> pipelineStorage; |
| + bool shouldDraw = this->setupPipelineAndShouldDraw(pipelineStorage.get(), pipelineInfo); |
| GrPipeline* pipeline = reinterpret_cast<GrPipeline*>(pipelineStorage.get()); |
| - if (!this->setupPipelineAndShouldDraw(pipeline, pipelineInfo)) { |
| + |
| + if (!shouldDraw) { |
| pipeline->~GrPipeline(); |
| return; |
| } |
| @@ -82,10 +84,11 @@ void GrImmediateDrawTarget::onFlush() { |
| } |
| bool |
| -GrImmediateDrawTarget::setupPipelineAndShouldDraw(GrPipeline* pipeline, |
| +GrImmediateDrawTarget::setupPipelineAndShouldDraw(void* pipelineAddr, |
|
krasin
2015/07/31 18:29:17
Note: using SkAlignedSStorage<sizeof(GrPipeline)>*
bsalomon
2015/07/31 18:55:11
My perhaps imperfect understanding is that the pur
|
| const GrDrawTarget::PipelineInfo& pipelineInfo) { |
| - this->setupPipeline(pipelineInfo, pipeline); |
| + this->setupPipeline(pipelineInfo, pipelineAddr); |
| + const GrPipeline* pipeline = reinterpret_cast<GrPipeline*>(pipelineAddr); |
|
krasin
2015/07/31 18:24:10
Proposal: setupPipeline could return GrPipeline*.
bsalomon
2015/07/31 18:55:11
Done.
|
| if (pipeline->mustSkip()) { |
| return false; |
| } |