Stack-allocate pipelines for GrMeshDrawOp
Stack-allocates the pipelines in onExecute. This saves us from having
to store the pipelines on the heap, as well as delaying the need to
detach processors until onExecute. The delay is an improvement because
it allows us to keep visiting proxies after onPrepare. (Previously,
they were moved out of GrProcessorSet and into a pipeline during
onPrepare, so visiting proxies was impossible after that point.)
Bug: skia:8731
Change-Id: Idc05063fb0dfbfed42b434e429fa5a497097bdae
Reviewed-on: https://skia-review.googlesource.com/c/193368
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/ops/GrDrawVerticesOp.cpp b/src/gpu/ops/GrDrawVerticesOp.cpp
index ec82f87..f1589ed 100644
--- a/src/gpu/ops/GrDrawVerticesOp.cpp
+++ b/src/gpu/ops/GrDrawVerticesOp.cpp
@@ -47,6 +47,7 @@
};
void onPrepareDraws(Target*) override;
+ void onExecute(GrOpFlushState*, const SkRect& chainBounds) override;
void drawVolatile(Target*);
void drawNonVolatile(Target*);
@@ -502,8 +503,11 @@
mesh->setNonIndexedNonInstanced(fVertexCount);
}
mesh->setVertexData(std::move(vertexBuffer), firstVertex);
- auto pipe = fHelper.makePipeline(target);
- target->draw(std::move(gp), pipe.fPipeline, pipe.fFixedDynamicState, mesh);
+ target->recordDraw(std::move(gp), mesh);
+}
+
+void DrawVerticesOp::onExecute(GrOpFlushState* flushState, const SkRect& chainBounds) {
+ fHelper.executeDrawsAndUploads(this, flushState, chainBounds);
}
GrOp::CombineResult DrawVerticesOp::onCombineIfPossible(GrOp* t, const GrCaps& caps) {