Begin implementing onPrePrepare for tessellation ops
Records programInfos for the stroke ops and for the stencil portions
of the path ops.
We can't prePrepare programInfos for the fill portions yet because it
would require multiple GrPipelines that all reference the same
GrProcessorSet. And GrProcessorSet is currently designed to be
std::moved into one single GrPipeline.
Bug: skia:10419
Change-Id: I3b8c061da181e20d3ff68746cf4b9c61f6d73a88
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319256
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/bench/TessellateBench.cpp b/bench/TessellateBench.cpp
index 4468aeb..10fc4f1 100644
--- a/bench/TessellateBench.cpp
+++ b/bench/TessellateBench.cpp
@@ -147,10 +147,14 @@
}
for (int i = 0; i < loops; ++i) {
fOp.fTriangleBuffer.reset();
- fOp.fDoStencilTriangleBuffer = false;
+ fOp.fTriangleVertexCount = 0;
+ fOp.fSharedStencilPipeline = nullptr;
+ fOp.fStencilTrianglesProgram = nullptr;
fOp.fDoFillTriangleBuffer = false;
fOp.fCubicBuffer.reset();
- fOp.fStencilCubicsShader = nullptr;
+ fOp.fCubicVertexCount = 0;
+ // Make fStencilTrianglesProgram non-null to keep assertions happy.
+ fOp.fStencilCubicsProgram = (GrProgramInfo*)-1;
this->runBench(&fTarget, &fOp);
fTarget.resetAllocator();
}
@@ -175,13 +179,16 @@
GrMeshDrawOp::Target* TARGET, GrPathTessellateOp* op)
DEF_PATH_TESS_BENCH(prepareMiddleOutStencilGeometry, make_cubic_path(), SkMatrix::I(), target, op) {
+ // Make fStencilTrianglesProgram non-null so we benchmark the tessellation path with separate
+ // triangles.
+ op->fStencilTrianglesProgram = (GrProgramInfo*)-1;
op->prepareMiddleOutTrianglesAndCubics(target);
}
DEF_PATH_TESS_BENCH(prepareMiddleOutStencilGeometry_indirect, make_cubic_path(), SkMatrix::I(),
target, op) {
GrResolveLevelCounter resolveLevelCounter;
- op->prepareMiddleOutTrianglesAndCubics(target, &resolveLevelCounter, true);
+ op->prepareMiddleOutTrianglesAndCubics(target, &resolveLevelCounter);
}
DEF_PATH_TESS_BENCH(prepareIndirectOuterCubics, make_cubic_path(), SkMatrix::I(), target, op) {