diff options
Diffstat (limited to 'src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp')
-rw-r--r-- | src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp b/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp index 35ac86c542..0c1b493471 100644 --- a/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp +++ b/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp @@ -112,19 +112,25 @@ bool GrCoverageCountingPathRenderer::onDrawPath(const DrawPathArgs& args) { SkPath croppedPath; path.transform(*args.fViewMatrix, &croppedPath); crop_path(croppedPath, clipIBounds, &croppedPath); - auto op = skstd::make_unique<GrCCDrawPathsOp>(this, std::move(args.fPaint), clipIBounds, - SkMatrix::I(), croppedPath, - croppedPath.getBounds()); - rtc->addDrawOp(*args.fClip, std::move(op)); + this->adoptAndRecordOp(new GrCCDrawPathsOp(this, std::move(args.fPaint), clipIBounds, + SkMatrix::I(), croppedPath, + croppedPath.getBounds()), args); return true; } - auto op = skstd::make_unique<GrCCDrawPathsOp>(this, std::move(args.fPaint), clipIBounds, - *args.fViewMatrix, path, devBounds); - rtc->addDrawOp(*args.fClip, std::move(op)); + this->adoptAndRecordOp(new GrCCDrawPathsOp(this, std::move(args.fPaint), clipIBounds, + *args.fViewMatrix, path, devBounds), args); return true; } +void GrCoverageCountingPathRenderer::adoptAndRecordOp(GrCCDrawPathsOp* op, + const DrawPathArgs& args) { + GrRenderTargetContext* rtc = args.fRenderTargetContext; + if (uint32_t opListID = rtc->addDrawOp(*args.fClip, std::unique_ptr<GrDrawOp>(op))) { + op->wasRecorded(&fRTPendingPathsMap[opListID]); + } +} + std::unique_ptr<GrFragmentProcessor> GrCoverageCountingPathRenderer::makeClipProcessor( GrProxyProvider* proxyProvider, uint32_t opListID, const SkPath& deviceSpacePath, const SkIRect& accessRect, |