diff options
author | bsalomon <bsalomon@google.com> | 2015-07-31 12:15:50 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-31 12:15:50 -0700 |
commit | 85cd78dd6ca93cc5bd4a504b201c3215426d885b (patch) | |
tree | 98775bb7a749a4b8a9c268d804b71ca50a2835b6 /src/gpu/GrImmediateDrawTarget.cpp | |
parent | ec994b65be292cd43cc0003ec91bae7c19d773aa (diff) |
Speculative fix for http://crbug.com/515966
BUG=chromium:515966
Review URL: https://codereview.chromium.org/1268723005
Diffstat (limited to 'src/gpu/GrImmediateDrawTarget.cpp')
-rw-r--r-- | src/gpu/GrImmediateDrawTarget.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gpu/GrImmediateDrawTarget.cpp b/src/gpu/GrImmediateDrawTarget.cpp index 0c4210ad70..0099b1dc8c 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,9 +84,9 @@ void GrImmediateDrawTarget::onFlush() { } bool -GrImmediateDrawTarget::setupPipelineAndShouldDraw(GrPipeline* pipeline, +GrImmediateDrawTarget::setupPipelineAndShouldDraw(void* pipelineAddr, const GrDrawTarget::PipelineInfo& pipelineInfo) { - this->setupPipeline(pipelineInfo, pipeline); + const GrPipeline* pipeline = this->setupPipeline(pipelineInfo, pipelineAddr); if (pipeline->mustSkip()) { return false; |