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/GrAtlasTextOp.cpp b/src/gpu/ops/GrAtlasTextOp.cpp
index fae54df..8e231cb 100644
--- a/src/gpu/ops/GrAtlasTextOp.cpp
+++ b/src/gpu/ops/GrAtlasTextOp.cpp
@@ -298,13 +298,16 @@
GR_STATIC_ASSERT(GrDistanceFieldA8TextGeoProc::kMaxTextures == kMaxTextures);
GR_STATIC_ASSERT(GrDistanceFieldLCDTextGeoProc::kMaxTextures == kMaxTextures);
- auto fixedDynamicState = target->makeFixedDynamicState(kMaxTextures);
+ static const uint32_t kPipelineFlags = 0;
+ auto pipe = target->makePipeline(kPipelineFlags, std::move(fProcessors),
+ target->detachAppliedClip(), kMaxTextures);
for (unsigned i = 0; i < numActiveProxies; ++i) {
- fixedDynamicState->fPrimitiveProcessorTextures[i] = proxies[i].get();
+ pipe.fFixedDynamicState->fPrimitiveProcessorTextures[i] = proxies[i].get();
}
FlushInfo flushInfo;
- flushInfo.fFixedDynamicState = fixedDynamicState;
+ flushInfo.fPipeline = pipe.fPipeline;
+ flushInfo.fFixedDynamicState = pipe.fFixedDynamicState;
bool vmPerspective = fGeoData[0].fViewMatrix.hasPerspective();
if (this->usesDistanceFields()) {
@@ -386,12 +389,6 @@
this->flush(target, &flushInfo);
}
-void GrAtlasTextOp::onExecute(GrOpFlushState* flushState, const SkRect& chainBounds) {
- static const uint32_t kPipelineFlags = 0;
- flushState->executeDrawsAndUploadsForMeshDrawOp(
- this, chainBounds, std::move(fProcessors), kPipelineFlags);
-}
-
void GrAtlasTextOp::flush(GrMeshDrawOp::Target* target, FlushInfo* flushInfo) const {
if (!flushInfo->fGlyphsToFlush) {
return;
@@ -431,8 +428,8 @@
mesh->setIndexedPatterned(flushInfo->fIndexBuffer, kIndicesPerGlyph, kVerticesPerGlyph,
flushInfo->fGlyphsToFlush, maxGlyphsPerDraw);
mesh->setVertexData(flushInfo->fVertexBuffer, flushInfo->fVertexOffset);
- target->recordDraw(
- flushInfo->fGeometryProcessor, mesh, 1, flushInfo->fFixedDynamicState, nullptr);
+ target->draw(flushInfo->fGeometryProcessor, flushInfo->fPipeline, flushInfo->fFixedDynamicState,
+ mesh);
flushInfo->fVertexOffset += kVerticesPerGlyph * flushInfo->fGlyphsToFlush;
flushInfo->fGlyphsToFlush = 0;
}