Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Unified Diff: src/gpu/GrImmediateDrawTarget.cpp

Issue 1268723005: Speculative fix for http://crbug.com/515966 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comment Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrImmediateDrawTarget.h ('k') | src/gpu/GrTargetCommands.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrImmediateDrawTarget.cpp
diff --git a/src/gpu/GrImmediateDrawTarget.cpp b/src/gpu/GrImmediateDrawTarget.cpp
index 0c4210ad705280cb94dbc4f1c2ce49ed825f485b..0099b1dc8cab705582a694af5609b31a8ee378e8 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;
« no previous file with comments | « src/gpu/GrImmediateDrawTarget.h ('k') | src/gpu/GrTargetCommands.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698