Revert "Stack-allocate pipelines for GrMeshDrawOp"
This reverts commit dfe5000a5ff2cabb50ddc139882dc1f3005fa429.
Reason for revert: HWAA pipeline flag not getting set for dashing.
Original change's description:
> 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>
TBR=robertphillips@google.com,csmartdalton@google.com
Change-Id: If706f19423310846de70288f393ac12f17ffeee5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8731
Reviewed-on: https://skia-review.googlesource.com/c/195161
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
diff --git a/src/gpu/ops/GrDefaultPathRenderer.cpp b/src/gpu/ops/GrDefaultPathRenderer.cpp
index 1ac80e6..7b50162 100644
--- a/src/gpu/ops/GrDefaultPathRenderer.cpp
+++ b/src/gpu/ops/GrDefaultPathRenderer.cpp
@@ -66,11 +66,14 @@
class PathGeoBuilder {
public:
PathGeoBuilder(GrPrimitiveType primitiveType, GrMeshDrawOp::Target* target,
- sk_sp<const GrGeometryProcessor> geometryProcessor)
+ sk_sp<const GrGeometryProcessor> geometryProcessor, const GrPipeline* pipeline,
+ const GrPipeline::FixedDynamicState* fixedDynamicState)
: fPrimitiveType(primitiveType)
, fTarget(target)
, fVertexStride(sizeof(SkPoint))
, fGeometryProcessor(std::move(geometryProcessor))
+ , fPipeline(pipeline)
+ , fFixedDynamicState(fixedDynamicState)
, fFirstIndex(0)
, fIndicesInChunk(0)
, fIndices(nullptr) {
@@ -276,7 +279,7 @@
vertexCount - 1, GrPrimitiveRestart::kNo);
}
mesh->setVertexData(std::move(fVertexBuffer), fFirstVertex);
- fTarget->recordDraw(fGeometryProcessor, mesh);
+ fTarget->draw(fGeometryProcessor, fPipeline, fFixedDynamicState, mesh);
}
fTarget->putBackIndices((size_t)(fIndicesInChunk - indexCount));
@@ -313,6 +316,8 @@
GrMeshDrawOp::Target* fTarget;
size_t fVertexStride;
sk_sp<const GrGeometryProcessor> fGeometryProcessor;
+ const GrPipeline* fPipeline;
+ const GrPipeline::FixedDynamicState* fFixedDynamicState;
sk_sp<const GrBuffer> fVertexBuffer;
int fFirstVertex;
@@ -425,7 +430,9 @@
} else {
primitiveType = GrPrimitiveType::kTriangles;
}
- PathGeoBuilder pathGeoBuilder(primitiveType, target, std::move(gp));
+ auto pipe = fHelper.makePipeline(target);
+ PathGeoBuilder pathGeoBuilder(primitiveType, target, std::move(gp), pipe.fPipeline,
+ pipe.fFixedDynamicState);
// fill buffers
for (int i = 0; i < instanceCount; i++) {
@@ -434,10 +441,6 @@
}
}
- void onExecute(GrOpFlushState* flushState, const SkRect& chainBounds) override {
- fHelper.executeDrawsAndUploads(this, flushState, chainBounds);
- }
-
CombineResult onCombineIfPossible(GrOp* t, const GrCaps& caps) override {
DefaultPathOp* that = t->cast<DefaultPathOp>();
if (!fHelper.isCompatible(that->fHelper, caps, this->bounds(), that->bounds())) {