Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2017 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #include "GrCoverageCountingPathRenderer.h" |
| 9 | |
| 10 | #include "GrCaps.h" |
| 11 | #include "GrClip.h" |
Robert Phillips | 777707b | 2018-01-17 11:40:14 -0500 | [diff] [blame] | 12 | #include "GrProxyProvider.h" |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 13 | #include "SkMakeUnique.h" |
Chris Dalton | a039d3b | 2017-09-28 11:16:36 -0600 | [diff] [blame] | 14 | #include "SkPathOps.h" |
Chris Dalton | 383a2ef | 2018-01-08 17:21:41 -0500 | [diff] [blame] | 15 | #include "ccpr/GrCCClipProcessor.h" |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame^] | 16 | #include "ccpr/GrCCPathParser.h" |
| 17 | #include "ccpr/GrCCPerFlushResources.h" |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 18 | |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame^] | 19 | using PathInstance = GrCCPathProcessor::Instance; |
Chris Dalton | a32a3c3 | 2017-12-05 10:05:21 -0700 | [diff] [blame] | 20 | |
| 21 | // If a path spans more pixels than this, we need to crop it or else analytic AA can run out of fp32 |
| 22 | // precision. |
| 23 | static constexpr float kPathCropThreshold = 1 << 16; |
| 24 | |
| 25 | static void crop_path(const SkPath& path, const SkIRect& cropbox, SkPath* out) { |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame^] | 26 | SkPath cropboxPath; |
| 27 | cropboxPath.addRect(SkRect::Make(cropbox)); |
| 28 | if (!Op(cropboxPath, path, kIntersect_SkPathOp, out)) { |
Chris Dalton | a32a3c3 | 2017-12-05 10:05:21 -0700 | [diff] [blame] | 29 | // This can fail if the PathOps encounter NaN or infinities. |
| 30 | out->reset(); |
| 31 | } |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame^] | 32 | out->setIsVolatile(true); |
Chris Dalton | a32a3c3 | 2017-12-05 10:05:21 -0700 | [diff] [blame] | 33 | } |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 34 | |
| 35 | bool GrCoverageCountingPathRenderer::IsSupported(const GrCaps& caps) { |
| 36 | const GrShaderCaps& shaderCaps = *caps.shaderCaps(); |
Chris Dalton | 383a2ef | 2018-01-08 17:21:41 -0500 | [diff] [blame] | 37 | return shaderCaps.integerSupport() && shaderCaps.flatInterpolationSupport() && |
| 38 | caps.instanceAttribSupport() && GrCaps::kNone_MapFlags != caps.mapBufferFlags() && |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 39 | caps.isConfigTexturable(kAlpha_half_GrPixelConfig) && |
Brian Salomon | bdecacf | 2018-02-02 20:32:49 -0500 | [diff] [blame] | 40 | caps.isConfigRenderable(kAlpha_half_GrPixelConfig) && |
Chris Dalton | e4679fa | 2017-09-29 13:58:26 -0600 | [diff] [blame] | 41 | !caps.blacklistCoverageCounting(); |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 42 | } |
| 43 | |
Chris Dalton | 383a2ef | 2018-01-08 17:21:41 -0500 | [diff] [blame] | 44 | sk_sp<GrCoverageCountingPathRenderer> GrCoverageCountingPathRenderer::CreateIfSupported( |
| 45 | const GrCaps& caps, bool drawCachablePaths) { |
Chris Dalton | a2ac30d | 2017-10-17 10:40:01 -0600 | [diff] [blame] | 46 | auto ccpr = IsSupported(caps) ? new GrCoverageCountingPathRenderer(drawCachablePaths) : nullptr; |
| 47 | return sk_sp<GrCoverageCountingPathRenderer>(ccpr); |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 48 | } |
| 49 | |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame^] | 50 | GrCoverageCountingPathRenderer::GrCoverageCountingPathRenderer(bool drawCachablePaths) |
| 51 | : fDrawCachablePaths(drawCachablePaths) { |
| 52 | } |
| 53 | |
| 54 | GrCoverageCountingPathRenderer::~GrCoverageCountingPathRenderer() { |
| 55 | // Ensure no Ops exist that could have a dangling pointer back into this class. |
| 56 | SkASSERT(fRTPendingPathsMap.empty()); |
| 57 | SkASSERT(0 == fNumOutstandingDrawOps); |
| 58 | } |
| 59 | |
Chris Dalton | 383a2ef | 2018-01-08 17:21:41 -0500 | [diff] [blame] | 60 | GrPathRenderer::CanDrawPath GrCoverageCountingPathRenderer::onCanDrawPath( |
| 61 | const CanDrawPathArgs& args) const { |
Chris Dalton | a2ac30d | 2017-10-17 10:40:01 -0600 | [diff] [blame] | 62 | if (args.fShape->hasUnstyledKey() && !fDrawCachablePaths) { |
| 63 | return CanDrawPath::kNo; |
| 64 | } |
| 65 | |
Chris Dalton | 383a2ef | 2018-01-08 17:21:41 -0500 | [diff] [blame] | 66 | if (!args.fShape->style().isSimpleFill() || args.fShape->inverseFilled() || |
| 67 | args.fViewMatrix->hasPerspective() || GrAAType::kCoverage != args.fAAType) { |
Chris Dalton | 5ed4423 | 2017-09-07 13:22:46 -0600 | [diff] [blame] | 68 | return CanDrawPath::kNo; |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 69 | } |
| 70 | |
| 71 | SkPath path; |
| 72 | args.fShape->asPath(&path); |
Chris Dalton | db91c6e | 2017-09-08 16:25:08 -0600 | [diff] [blame] | 73 | SkRect devBounds; |
| 74 | SkIRect devIBounds; |
| 75 | args.fViewMatrix->mapRect(&devBounds, path.getBounds()); |
| 76 | devBounds.roundOut(&devIBounds); |
| 77 | if (!devIBounds.intersect(*args.fClipConservativeBounds)) { |
| 78 | // Path is completely clipped away. Our code will eventually notice this before doing any |
| 79 | // real work. |
| 80 | return CanDrawPath::kYes; |
| 81 | } |
| 82 | |
| 83 | if (devIBounds.height() * devIBounds.width() > 256 * 256) { |
| 84 | // Large paths can blow up the atlas fast. And they are not ideal for a two-pass rendering |
| 85 | // algorithm. Give the simpler direct renderers a chance before we commit to drawing it. |
| 86 | return CanDrawPath::kAsBackup; |
| 87 | } |
| 88 | |
| 89 | if (args.fShape->hasUnstyledKey() && path.countVerbs() > 50) { |
| 90 | // Complex paths do better cached in an SDF, if the renderer will accept them. |
| 91 | return CanDrawPath::kAsBackup; |
| 92 | } |
| 93 | |
Chris Dalton | 5ed4423 | 2017-09-07 13:22:46 -0600 | [diff] [blame] | 94 | return CanDrawPath::kYes; |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 95 | } |
| 96 | |
| 97 | bool GrCoverageCountingPathRenderer::onDrawPath(const DrawPathArgs& args) { |
| 98 | SkASSERT(!fFlushing); |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 99 | |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame^] | 100 | SkIRect clipIBounds; |
| 101 | GrRenderTargetContext* rtc = args.fRenderTargetContext; |
| 102 | args.fClip->getConservativeBounds(rtc->width(), rtc->height(), &clipIBounds, nullptr); |
| 103 | |
| 104 | SkPath path; |
| 105 | args.fShape->asPath(&path); |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 106 | |
| 107 | SkRect devBounds; |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame^] | 108 | args.fViewMatrix->mapRect(&devBounds, path.getBounds()); |
| 109 | |
Chris Dalton | a32a3c3 | 2017-12-05 10:05:21 -0700 | [diff] [blame] | 110 | if (SkTMax(devBounds.height(), devBounds.width()) > kPathCropThreshold) { |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame^] | 111 | // The path is too large. Crop it or analytic AA can run out of fp32 precision. |
| 112 | SkPath croppedPath; |
| 113 | path.transform(*args.fViewMatrix, &croppedPath); |
| 114 | crop_path(croppedPath, clipIBounds, &croppedPath); |
| 115 | auto op = skstd::make_unique<GrCCDrawPathsOp>(this, std::move(args.fPaint), clipIBounds, |
| 116 | SkMatrix::I(), croppedPath, path.getBounds()); |
| 117 | rtc->addDrawOp(*args.fClip, std::move(op)); |
| 118 | return true; |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 119 | } |
| 120 | |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame^] | 121 | auto op = skstd::make_unique<GrCCDrawPathsOp>(this, std::move(args.fPaint), clipIBounds, |
| 122 | *args.fViewMatrix, path, devBounds); |
| 123 | rtc->addDrawOp(*args.fClip, std::move(op)); |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 124 | return true; |
| 125 | } |
| 126 | |
Chris Dalton | 383a2ef | 2018-01-08 17:21:41 -0500 | [diff] [blame] | 127 | std::unique_ptr<GrFragmentProcessor> GrCoverageCountingPathRenderer::makeClipProcessor( |
Robert Phillips | 777707b | 2018-01-17 11:40:14 -0500 | [diff] [blame] | 128 | GrProxyProvider* proxyProvider, |
| 129 | uint32_t opListID, const SkPath& deviceSpacePath, const SkIRect& accessRect, |
| 130 | int rtWidth, int rtHeight) { |
Chris Dalton | 383a2ef | 2018-01-08 17:21:41 -0500 | [diff] [blame] | 131 | using MustCheckBounds = GrCCClipProcessor::MustCheckBounds; |
Chris Dalton | a32a3c3 | 2017-12-05 10:05:21 -0700 | [diff] [blame] | 132 | |
| 133 | SkASSERT(!fFlushing); |
Chris Dalton | a32a3c3 | 2017-12-05 10:05:21 -0700 | [diff] [blame] | 134 | |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame^] | 135 | GrCCClipPath& clipPath = |
| 136 | fRTPendingPathsMap[opListID].fClipPaths[deviceSpacePath.getGenerationID()]; |
| 137 | if (!clipPath.isInitialized()) { |
Chris Dalton | a32a3c3 | 2017-12-05 10:05:21 -0700 | [diff] [blame] | 138 | // This ClipPath was just created during lookup. Initialize it. |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame^] | 139 | const SkRect& pathDevBounds = deviceSpacePath.getBounds(); |
| 140 | if (SkTMax(pathDevBounds.height(), pathDevBounds.width()) > kPathCropThreshold) { |
| 141 | // The path is too large. Crop it or analytic AA can run out of fp32 precision. |
| 142 | SkPath croppedPath; |
| 143 | int maxRTSize = proxyProvider->caps()->maxRenderTargetSize(); |
| 144 | crop_path(deviceSpacePath, SkIRect::MakeWH(maxRTSize, maxRTSize), &croppedPath); |
| 145 | clipPath.init(proxyProvider, croppedPath, accessRect, rtWidth, rtHeight); |
| 146 | } else { |
| 147 | clipPath.init(proxyProvider, deviceSpacePath, accessRect, rtWidth, rtHeight); |
| 148 | } |
Chris Dalton | a32a3c3 | 2017-12-05 10:05:21 -0700 | [diff] [blame] | 149 | } else { |
| 150 | clipPath.addAccess(accessRect); |
| 151 | } |
| 152 | |
| 153 | bool mustCheckBounds = !clipPath.pathDevIBounds().contains(accessRect); |
Chris Dalton | 383a2ef | 2018-01-08 17:21:41 -0500 | [diff] [blame] | 154 | return skstd::make_unique<GrCCClipProcessor>(&clipPath, MustCheckBounds(mustCheckBounds), |
| 155 | deviceSpacePath.getFillType()); |
Chris Dalton | a32a3c3 | 2017-12-05 10:05:21 -0700 | [diff] [blame] | 156 | } |
| 157 | |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 158 | void GrCoverageCountingPathRenderer::preFlush(GrOnFlushResourceProvider* onFlushRP, |
| 159 | const uint32_t* opListIDs, int numOpListIDs, |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame^] | 160 | SkTArray<sk_sp<GrRenderTargetContext>>* atlasDraws) { |
Chris Dalton | a32a3c3 | 2017-12-05 10:05:21 -0700 | [diff] [blame] | 161 | SkASSERT(!fFlushing); |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame^] | 162 | SkASSERT(!fPerFlushResources); |
Chris Dalton | 383a2ef | 2018-01-08 17:21:41 -0500 | [diff] [blame] | 163 | SkDEBUGCODE(fFlushing = true); |
Chris Dalton | a32a3c3 | 2017-12-05 10:05:21 -0700 | [diff] [blame] | 164 | |
| 165 | if (fRTPendingPathsMap.empty()) { |
Chris Dalton | 383a2ef | 2018-01-08 17:21:41 -0500 | [diff] [blame] | 166 | return; // Nothing to draw. |
Chris Dalton | a32a3c3 | 2017-12-05 10:05:21 -0700 | [diff] [blame] | 167 | } |
Chris Dalton | c1e5963 | 2017-09-05 00:30:07 -0600 | [diff] [blame] | 168 | |
Chris Dalton | 3917b1e | 2018-05-09 00:40:52 -0600 | [diff] [blame] | 169 | // Count up the paths about to be flushed so we can preallocate buffers. |
| 170 | int numPathDraws = 0; |
| 171 | int numClipPaths = 0; |
| 172 | GrCCPathParser::PathStats flushingPathStats; |
| 173 | fFlushingRTPathIters.reserve(numOpListIDs); |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 174 | for (int i = 0; i < numOpListIDs; ++i) { |
Chris Dalton | 3917b1e | 2018-05-09 00:40:52 -0600 | [diff] [blame] | 175 | auto iter = fRTPendingPathsMap.find(opListIDs[i]); |
| 176 | if (fRTPendingPathsMap.end() == iter) { |
Chris Dalton | 080baa4 | 2017-11-06 14:19:19 -0700 | [diff] [blame] | 177 | continue; |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 178 | } |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame^] | 179 | const GrCCRTPendingPaths& rtPendingPaths = iter->second; |
Chris Dalton | a32a3c3 | 2017-12-05 10:05:21 -0700 | [diff] [blame] | 180 | |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame^] | 181 | SkTInternalLList<GrCCDrawPathsOp>::Iter drawOpsIter; |
Chris Dalton | a32a3c3 | 2017-12-05 10:05:21 -0700 | [diff] [blame] | 182 | drawOpsIter.init(rtPendingPaths.fDrawOps, |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame^] | 183 | SkTInternalLList<GrCCDrawPathsOp>::Iter::kHead_IterStart); |
| 184 | while (GrCCDrawPathsOp* op = drawOpsIter.get()) { |
| 185 | for (const GrCCDrawPathsOp::SingleDraw* draw = op->head(); draw; draw = draw->fNext) { |
Chris Dalton | 3917b1e | 2018-05-09 00:40:52 -0600 | [diff] [blame] | 186 | ++numPathDraws; |
| 187 | flushingPathStats.statPath(draw->fPath); |
Chris Dalton | 080baa4 | 2017-11-06 14:19:19 -0700 | [diff] [blame] | 188 | } |
Chris Dalton | a32a3c3 | 2017-12-05 10:05:21 -0700 | [diff] [blame] | 189 | drawOpsIter.next(); |
Chris Dalton | 080baa4 | 2017-11-06 14:19:19 -0700 | [diff] [blame] | 190 | } |
Chris Dalton | a32a3c3 | 2017-12-05 10:05:21 -0700 | [diff] [blame] | 191 | |
Chris Dalton | 3917b1e | 2018-05-09 00:40:52 -0600 | [diff] [blame] | 192 | numClipPaths += rtPendingPaths.fClipPaths.size(); |
Chris Dalton | a32a3c3 | 2017-12-05 10:05:21 -0700 | [diff] [blame] | 193 | for (const auto& clipsIter : rtPendingPaths.fClipPaths) { |
Chris Dalton | 3917b1e | 2018-05-09 00:40:52 -0600 | [diff] [blame] | 194 | flushingPathStats.statPath(clipsIter.second.deviceSpacePath()); |
Chris Dalton | a32a3c3 | 2017-12-05 10:05:21 -0700 | [diff] [blame] | 195 | } |
Chris Dalton | 3917b1e | 2018-05-09 00:40:52 -0600 | [diff] [blame] | 196 | |
| 197 | fFlushingRTPathIters.push_back(std::move(iter)); |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 198 | } |
| 199 | |
Chris Dalton | 3917b1e | 2018-05-09 00:40:52 -0600 | [diff] [blame] | 200 | if (0 == numPathDraws + numClipPaths) { |
Chris Dalton | 383a2ef | 2018-01-08 17:21:41 -0500 | [diff] [blame] | 201 | return; // Nothing to draw. |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 202 | } |
| 203 | |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame^] | 204 | auto resources = skstd::make_unique<GrCCPerFlushResources>(onFlushRP, numPathDraws, |
| 205 | numClipPaths, flushingPathStats); |
| 206 | if (!resources->isMapped()) { |
| 207 | return; // Some allocation failed. |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 208 | } |
| 209 | |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame^] | 210 | // Layout atlas(es) and parse paths. |
Chris Dalton | 3917b1e | 2018-05-09 00:40:52 -0600 | [diff] [blame] | 211 | SkDEBUGCODE(int numSkippedPaths = 0); |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame^] | 212 | for (int i = 0; i < numOpListIDs; ++i) { |
| 213 | auto it = fRTPendingPathsMap.find(opListIDs[i]); |
| 214 | if (fRTPendingPathsMap.end() == it) { |
| 215 | continue; |
| 216 | } |
| 217 | GrCCRTPendingPaths& rtPendingPaths = it->second; |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 218 | |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame^] | 219 | SkTInternalLList<GrCCDrawPathsOp>::Iter drawOpsIter; |
| 220 | drawOpsIter.init(rtPendingPaths.fDrawOps, |
| 221 | SkTInternalLList<GrCCDrawPathsOp>::Iter::kHead_IterStart); |
| 222 | while (GrCCDrawPathsOp* op = drawOpsIter.get()) { |
| 223 | op->setupResources(resources.get(), onFlushRP); |
Chris Dalton | a32a3c3 | 2017-12-05 10:05:21 -0700 | [diff] [blame] | 224 | drawOpsIter.next(); |
Chris Dalton | 3917b1e | 2018-05-09 00:40:52 -0600 | [diff] [blame] | 225 | SkDEBUGCODE(numSkippedPaths += op->numSkippedInstances_debugOnly()); |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 226 | } |
| 227 | |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame^] | 228 | for (auto& clipsIter : rtPendingPaths.fClipPaths) { |
| 229 | clipsIter.second.placePathInAtlas(resources.get(), onFlushRP); |
Chris Dalton | c1e5963 | 2017-09-05 00:30:07 -0600 | [diff] [blame] | 230 | } |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 231 | } |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame^] | 232 | SkASSERT(resources->pathInstanceCount() == numPathDraws - numSkippedPaths); |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 233 | |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame^] | 234 | // Allocate the atlases and create instance buffers to draw them. |
| 235 | if (!resources->finalize(onFlushRP, atlasDraws)) { |
Chris Dalton | c1e5963 | 2017-09-05 00:30:07 -0600 | [diff] [blame] | 236 | return; |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 237 | } |
| 238 | |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame^] | 239 | fPerFlushResources = std::move(resources); |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 240 | } |
| 241 | |
Chris Dalton | 3968ff9 | 2017-11-27 12:26:31 -0700 | [diff] [blame] | 242 | void GrCoverageCountingPathRenderer::postFlush(GrDeferredUploadToken, const uint32_t* opListIDs, |
| 243 | int numOpListIDs) { |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 244 | SkASSERT(fFlushing); |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame^] | 245 | fPerFlushResources.reset(); |
Chris Dalton | a32a3c3 | 2017-12-05 10:05:21 -0700 | [diff] [blame] | 246 | // We wait to erase these until after flush, once Ops and FPs are done accessing their data. |
Chris Dalton | 3917b1e | 2018-05-09 00:40:52 -0600 | [diff] [blame] | 247 | for (const auto& iter : fFlushingRTPathIters) { |
| 248 | fRTPendingPathsMap.erase(iter); |
Chris Dalton | a32a3c3 | 2017-12-05 10:05:21 -0700 | [diff] [blame] | 249 | } |
Chris Dalton | 3917b1e | 2018-05-09 00:40:52 -0600 | [diff] [blame] | 250 | fFlushingRTPathIters.reset(); |
Chris Dalton | 383a2ef | 2018-01-08 17:21:41 -0500 | [diff] [blame] | 251 | SkDEBUGCODE(fFlushing = false); |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 252 | } |