Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018 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 "GrCCDrawPathsOp.h" |
| 9 | |
Robert Phillips | 7c525e6 | 2018-06-12 10:11:12 -0400 | [diff] [blame] | 10 | #include "GrMemoryPool.h" |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame] | 11 | #include "GrOpFlushState.h" |
| 12 | #include "ccpr/GrCCPerFlushResources.h" |
| 13 | #include "ccpr/GrCoverageCountingPathRenderer.h" |
| 14 | |
Chris Dalton | 1c54894 | 2018-05-22 13:09:48 -0600 | [diff] [blame] | 15 | static bool has_coord_transforms(const GrPaint& paint) { |
| 16 | GrFragmentProcessor::Iter iter(paint); |
| 17 | while (const GrFragmentProcessor* fp = iter.next()) { |
| 18 | if (!fp->coordTransforms().empty()) { |
| 19 | return true; |
| 20 | } |
| 21 | } |
| 22 | return false; |
| 23 | } |
| 24 | |
Robert Phillips | 4f6ba2e | 2018-06-15 15:59:38 +0000 | [diff] [blame] | 25 | std::unique_ptr<GrCCDrawPathsOp> GrCCDrawPathsOp::Make(GrContext*, const SkIRect& clipIBounds, |
Chris Dalton | 4da7019 | 2018-06-18 09:51:36 -0600 | [diff] [blame] | 26 | const SkMatrix& m, const GrShape& shape, |
Robert Phillips | 4f6ba2e | 2018-06-15 15:59:38 +0000 | [diff] [blame] | 27 | const SkRect& devBounds, GrPaint&& paint) { |
Chris Dalton | 4da7019 | 2018-06-18 09:51:36 -0600 | [diff] [blame] | 28 | bool canStashPathMask = true; |
Chris Dalton | 42c2115 | 2018-06-13 15:28:19 -0600 | [diff] [blame] | 29 | SkIRect looseClippedIBounds; |
| 30 | devBounds.roundOut(&looseClippedIBounds); // GrCCPathParser might find slightly tighter bounds. |
Chris Dalton | 4da7019 | 2018-06-18 09:51:36 -0600 | [diff] [blame] | 31 | if (!clipIBounds.contains(looseClippedIBounds)) { |
| 32 | canStashPathMask = false; |
| 33 | if (!looseClippedIBounds.intersect(clipIBounds)) { |
| 34 | return nullptr; |
| 35 | } |
Chris Dalton | 42c2115 | 2018-06-13 15:28:19 -0600 | [diff] [blame] | 36 | } |
Chris Dalton | 4da7019 | 2018-06-18 09:51:36 -0600 | [diff] [blame] | 37 | return std::unique_ptr<GrCCDrawPathsOp>(new GrCCDrawPathsOp(looseClippedIBounds, m, shape, |
| 38 | canStashPathMask, devBounds, |
| 39 | std::move(paint))); |
Chris Dalton | 42c2115 | 2018-06-13 15:28:19 -0600 | [diff] [blame] | 40 | } |
| 41 | |
| 42 | GrCCDrawPathsOp::GrCCDrawPathsOp(const SkIRect& looseClippedIBounds, const SkMatrix& m, |
Chris Dalton | 4da7019 | 2018-06-18 09:51:36 -0600 | [diff] [blame] | 43 | const GrShape& shape, bool canStashPathMask, |
| 44 | const SkRect& devBounds, GrPaint&& paint) |
Chris Dalton | 4bfb50b | 2018-05-21 09:10:53 -0600 | [diff] [blame] | 45 | : GrDrawOp(ClassID()) |
Chris Dalton | d7e2227 | 2018-05-23 10:17:17 -0600 | [diff] [blame] | 46 | , fViewMatrixIfUsingLocalCoords(has_coord_transforms(paint) ? m : SkMatrix::I()) |
Chris Dalton | 42c2115 | 2018-06-13 15:28:19 -0600 | [diff] [blame] | 47 | , fSRGBFlags(GrPipeline::SRGBFlagsFromPaint(paint)) |
Chris Dalton | 4da7019 | 2018-06-18 09:51:36 -0600 | [diff] [blame] | 48 | , fDraws({looseClippedIBounds, m, shape, paint.getColor(), nullptr, nullptr, {0, 0}, |
| 49 | canStashPathMask, nullptr}) |
Chris Dalton | 42c2115 | 2018-06-13 15:28:19 -0600 | [diff] [blame] | 50 | , fProcessors(std::move(paint)) { // Paint must be moved after fetching its color above. |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame] | 51 | SkDEBUGCODE(fBaseInstance = -1); |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame] | 52 | // FIXME: intersect with clip bounds to (hopefully) improve batching. |
| 53 | // (This is nontrivial due to assumptions in generating the octagon cover geometry.) |
| 54 | this->setBounds(devBounds, GrOp::HasAABloat::kYes, GrOp::IsZeroArea::kNo); |
| 55 | } |
| 56 | |
| 57 | GrCCDrawPathsOp::~GrCCDrawPathsOp() { |
Chris Dalton | d7e2227 | 2018-05-23 10:17:17 -0600 | [diff] [blame] | 58 | if (fOwningPerOpListPaths) { |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame] | 59 | // Remove CCPR's dangling pointer to this Op before deleting it. |
Chris Dalton | d7e2227 | 2018-05-23 10:17:17 -0600 | [diff] [blame] | 60 | fOwningPerOpListPaths->fDrawOps.remove(this); |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame] | 61 | } |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame] | 62 | } |
| 63 | |
Chris Dalton | 4da7019 | 2018-06-18 09:51:36 -0600 | [diff] [blame] | 64 | GrCCDrawPathsOp::SingleDraw::~SingleDraw() { |
| 65 | if (fCacheEntry) { |
| 66 | // All currFlushAtlas references must be reset back to null before the flush is finished. |
| 67 | fCacheEntry->setCurrFlushAtlas(nullptr); |
| 68 | } |
| 69 | } |
| 70 | |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame] | 71 | GrDrawOp::RequiresDstTexture GrCCDrawPathsOp::finalize(const GrCaps& caps, |
| 72 | const GrAppliedClip* clip, |
| 73 | GrPixelConfigIsClamped dstIsClamped) { |
Chris Dalton | 4da7019 | 2018-06-18 09:51:36 -0600 | [diff] [blame] | 74 | SkASSERT(1 == fNumDraws); // There should only be one single path draw in this Op right now. |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame] | 75 | GrProcessorSet::Analysis analysis = |
Chris Dalton | 4bfb50b | 2018-05-21 09:10:53 -0600 | [diff] [blame] | 76 | fProcessors.finalize(fDraws.head().fColor, GrProcessorAnalysisCoverage::kSingleChannel, |
| 77 | clip, false, caps, dstIsClamped, &fDraws.head().fColor); |
Chris Dalton | 4da7019 | 2018-06-18 09:51:36 -0600 | [diff] [blame] | 78 | return RequiresDstTexture(analysis.requiresDstTexture()); |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame] | 79 | } |
| 80 | |
Chris Dalton | 4da7019 | 2018-06-18 09:51:36 -0600 | [diff] [blame] | 81 | bool GrCCDrawPathsOp::onCombineIfPossible(GrOp* op, const GrCaps&) { |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame] | 82 | GrCCDrawPathsOp* that = op->cast<GrCCDrawPathsOp>(); |
Chris Dalton | d7e2227 | 2018-05-23 10:17:17 -0600 | [diff] [blame] | 83 | SkASSERT(fOwningPerOpListPaths); |
Chris Dalton | 4bfb50b | 2018-05-21 09:10:53 -0600 | [diff] [blame] | 84 | SkASSERT(fNumDraws); |
Chris Dalton | d7e2227 | 2018-05-23 10:17:17 -0600 | [diff] [blame] | 85 | SkASSERT(!that->fOwningPerOpListPaths || that->fOwningPerOpListPaths == fOwningPerOpListPaths); |
Chris Dalton | 4bfb50b | 2018-05-21 09:10:53 -0600 | [diff] [blame] | 86 | SkASSERT(that->fNumDraws); |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame] | 87 | |
Chris Dalton | daef06a | 2018-05-23 17:11:09 -0600 | [diff] [blame] | 88 | if (fSRGBFlags != that->fSRGBFlags || fProcessors != that->fProcessors || |
Chris Dalton | 1c54894 | 2018-05-22 13:09:48 -0600 | [diff] [blame] | 89 | fViewMatrixIfUsingLocalCoords != that->fViewMatrixIfUsingLocalCoords) { |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame] | 90 | return false; |
| 91 | } |
| 92 | |
Chris Dalton | d7e2227 | 2018-05-23 10:17:17 -0600 | [diff] [blame] | 93 | fDraws.append(std::move(that->fDraws), &fOwningPerOpListPaths->fAllocator); |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame] | 94 | this->joinBounds(*that); |
| 95 | |
Chris Dalton | 4bfb50b | 2018-05-21 09:10:53 -0600 | [diff] [blame] | 96 | SkDEBUGCODE(fNumDraws += that->fNumDraws); |
| 97 | SkDEBUGCODE(that->fNumDraws = 0); |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame] | 98 | return true; |
| 99 | } |
| 100 | |
Chris Dalton | d7e2227 | 2018-05-23 10:17:17 -0600 | [diff] [blame] | 101 | void GrCCDrawPathsOp::wasRecorded(GrCCPerOpListPaths* owningPerOpListPaths) { |
Chris Dalton | f104fec | 2018-05-22 16:17:48 -0600 | [diff] [blame] | 102 | SkASSERT(1 == fNumDraws); |
Chris Dalton | d7e2227 | 2018-05-23 10:17:17 -0600 | [diff] [blame] | 103 | SkASSERT(!fOwningPerOpListPaths); |
| 104 | owningPerOpListPaths->fDrawOps.addToTail(this); |
| 105 | fOwningPerOpListPaths = owningPerOpListPaths; |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame] | 106 | } |
| 107 | |
Chris Dalton | 4da7019 | 2018-06-18 09:51:36 -0600 | [diff] [blame] | 108 | void GrCCDrawPathsOp::accountForOwnPaths(GrCCPathCache* pathCache, |
| 109 | GrOnFlushResourceProvider* onFlushRP, |
| 110 | const GrUniqueKey& stashedAtlasKey, |
| 111 | GrCCPerFlushResourceSpecs* specs) { |
| 112 | using CreateIfAbsent = GrCCPathCache::CreateIfAbsent; |
| 113 | using MaskTransform = GrCCPathCache::MaskTransform; |
| 114 | |
| 115 | for (SingleDraw& draw : fDraws) { |
| 116 | SkASSERT(!draw.fCacheEntry); |
| 117 | |
| 118 | SkPath path; |
| 119 | draw.fShape.asPath(&path); |
| 120 | |
| 121 | MaskTransform m(draw.fMatrix, &draw.fCachedMaskShift); |
| 122 | draw.fCacheEntry = pathCache->find(draw.fShape, m, CreateIfAbsent(draw.fCanStashPathMask)); |
| 123 | if (auto cacheEntry = draw.fCacheEntry.get()) { |
| 124 | SkASSERT(!cacheEntry->currFlushAtlas()); // Shouldn't be set until setupResources(). |
| 125 | if (cacheEntry->atlasKey().isValid()) { |
| 126 | // Does the path already exist in a cached atlas? |
| 127 | if (cacheEntry->hasCachedAtlas() && |
| 128 | (draw.fCachedAtlasProxy = onFlushRP->findOrCreateProxyByUniqueKey( |
| 129 | cacheEntry->atlasKey(), |
| 130 | GrCCAtlas::kTextureOrigin))) { |
| 131 | ++specs->fNumCachedPaths; |
| 132 | continue; |
| 133 | } |
| 134 | |
| 135 | // Does the path exist in the atlas that we stashed away from last flush? If so we |
| 136 | // can copy it into a new 8-bit atlas and keep it in the resource cache. |
| 137 | if (stashedAtlasKey.isValid() && stashedAtlasKey == cacheEntry->atlasKey()) { |
| 138 | SkASSERT(!cacheEntry->hasCachedAtlas()); |
| 139 | ++specs->fNumCopiedPaths; |
| 140 | specs->fCopyPathStats.statPath(path); |
| 141 | specs->fCopyAtlasSpecs.accountForSpace(cacheEntry->width(), |
| 142 | cacheEntry->height()); |
| 143 | continue; |
| 144 | } |
| 145 | |
| 146 | // Whatever atlas the path used to reside in, it no longer exists. |
| 147 | cacheEntry->resetAtlasKeyAndInfo(); |
| 148 | } |
| 149 | |
| 150 | if (!draw.fCanStashPathMask) { |
| 151 | // No point in keeping this cache entry around anymore if we aren't going to try and |
| 152 | // stash the the rendered path mask after flush. |
| 153 | draw.fCacheEntry = nullptr; |
| 154 | pathCache->evict(cacheEntry); |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | ++specs->fNumRenderedPaths; |
| 159 | specs->fRenderedPathStats.statPath(path); |
| 160 | specs->fRenderedAtlasSpecs.accountForSpace(draw.fLooseClippedIBounds.width(), |
Chris Dalton | 42c2115 | 2018-06-13 15:28:19 -0600 | [diff] [blame] | 161 | draw.fLooseClippedIBounds.height()); |
Chris Dalton | 4bfb50b | 2018-05-21 09:10:53 -0600 | [diff] [blame] | 162 | } |
Chris Dalton | 4bfb50b | 2018-05-21 09:10:53 -0600 | [diff] [blame] | 163 | } |
| 164 | |
Chris Dalton | 4da7019 | 2018-06-18 09:51:36 -0600 | [diff] [blame] | 165 | void GrCCDrawPathsOp::setupResources(GrOnFlushResourceProvider* onFlushRP, |
| 166 | GrCCPerFlushResources* resources, DoCopiesToCache doCopies) { |
| 167 | using DoEvenOddFill = GrCCPathProcessor::DoEvenOddFill; |
Chris Dalton | 4bfb50b | 2018-05-21 09:10:53 -0600 | [diff] [blame] | 168 | SkASSERT(fNumDraws > 0); |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame] | 169 | SkASSERT(-1 == fBaseInstance); |
Chris Dalton | daef06a | 2018-05-23 17:11:09 -0600 | [diff] [blame] | 170 | fBaseInstance = resources->nextPathInstanceIdx(); |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame] | 171 | |
Chris Dalton | 4da7019 | 2018-06-18 09:51:36 -0600 | [diff] [blame] | 172 | for (SingleDraw& draw : fDraws) { |
| 173 | SkPath path; |
| 174 | draw.fShape.asPath(&path); |
| 175 | |
| 176 | auto doEvenOddFill = DoEvenOddFill(SkPath::kEvenOdd_FillType == path.getFillType()); |
| 177 | SkASSERT(SkPath::kEvenOdd_FillType == path.getFillType() || |
| 178 | SkPath::kWinding_FillType == path.getFillType()); |
| 179 | |
| 180 | if (auto cacheEntry = draw.fCacheEntry.get()) { |
| 181 | // Does the path already exist in a cached atlas texture? |
| 182 | if (auto proxy = draw.fCachedAtlasProxy.get()) { |
| 183 | SkASSERT(!cacheEntry->currFlushAtlas()); |
| 184 | this->recordInstance(proxy, resources->nextPathInstanceIdx()); |
| 185 | resources->appendDrawPathInstance().set(*cacheEntry, draw.fCachedMaskShift, |
| 186 | draw.fColor); |
| 187 | continue; |
| 188 | } |
| 189 | |
| 190 | // Have we already encountered this path during the flush? (i.e. was the same SkPath |
| 191 | // drawn more than once during the same flush, with a compatible matrix?) |
| 192 | if (auto atlas = cacheEntry->currFlushAtlas()) { |
| 193 | this->recordInstance(atlas->textureProxy(), resources->nextPathInstanceIdx()); |
| 194 | resources->appendDrawPathInstance().set( |
| 195 | *cacheEntry, draw.fCachedMaskShift, draw.fColor, |
| 196 | cacheEntry->hasCachedAtlas() ? DoEvenOddFill::kNo : doEvenOddFill); |
| 197 | continue; |
| 198 | } |
| 199 | |
| 200 | // If the cache entry still has a valid atlas key at this point, it means the path |
| 201 | // exists in the atlas that we stashed away from last flush. Copy it into a permanent |
| 202 | // 8-bit atlas in the resource cache. |
| 203 | if (DoCopiesToCache::kYes == doCopies && cacheEntry->atlasKey().isValid()) { |
| 204 | SkIVector newOffset; |
| 205 | GrCCAtlas* atlas = |
| 206 | resources->copyPathToCachedAtlas(*cacheEntry, doEvenOddFill, &newOffset); |
| 207 | cacheEntry->updateToCachedAtlas(atlas->getOrAssignUniqueKey(onFlushRP), |
| 208 | newOffset, atlas->refOrMakeCachedAtlasInfo()); |
| 209 | this->recordInstance(atlas->textureProxy(), resources->nextPathInstanceIdx()); |
| 210 | resources->appendDrawPathInstance().set(*cacheEntry, draw.fCachedMaskShift, |
| 211 | draw.fColor); |
| 212 | // Remember this atlas in case we encounter the path again during the same flush. |
| 213 | cacheEntry->setCurrFlushAtlas(atlas); |
| 214 | continue; |
| 215 | } |
| 216 | } |
| 217 | |
| 218 | // Render the raw path into a coverage count atlas. renderPathInAtlas() gives us two tight |
| 219 | // bounding boxes: One in device space, as well as a second one rotated an additional 45 |
| 220 | // degrees. The path vertex shader uses these two bounding boxes to generate an octagon that |
| 221 | // circumscribes the path. |
| 222 | SkASSERT(!draw.fCachedAtlasProxy); |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame] | 223 | SkRect devBounds, devBounds45; |
Chris Dalton | 4da7019 | 2018-06-18 09:51:36 -0600 | [diff] [blame] | 224 | SkIRect devIBounds; |
Chris Dalton | 9414c96 | 2018-06-14 10:14:50 -0600 | [diff] [blame] | 225 | SkIVector devToAtlasOffset; |
Chris Dalton | 4da7019 | 2018-06-18 09:51:36 -0600 | [diff] [blame] | 226 | if (auto atlas = resources->renderPathInAtlas(draw.fLooseClippedIBounds, draw.fMatrix, path, |
| 227 | &devBounds, &devBounds45, &devIBounds, |
| 228 | &devToAtlasOffset)) { |
| 229 | this->recordInstance(atlas->textureProxy(), resources->nextPathInstanceIdx()); |
| 230 | resources->appendDrawPathInstance().set(devBounds, devBounds45, devToAtlasOffset, |
| 231 | draw.fColor, doEvenOddFill); |
| 232 | if (draw.fCacheEntry && draw.fCanStashPathMask && |
| 233 | resources->nextAtlasToStash() == atlas) { |
| 234 | const GrUniqueKey& atlasKey = |
| 235 | resources->nextAtlasToStash()->getOrAssignUniqueKey(onFlushRP); |
| 236 | draw.fCacheEntry->initAsStashedAtlas(atlasKey, devToAtlasOffset, devBounds, |
| 237 | devBounds45, devIBounds, |
| 238 | draw.fCachedMaskShift); |
| 239 | // Remember this atlas in case we encounter the path again during the same flush. |
| 240 | draw.fCacheEntry->setCurrFlushAtlas(atlas); |
| 241 | } |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame] | 242 | continue; |
| 243 | } |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame] | 244 | } |
| 245 | |
Chris Dalton | 4da7019 | 2018-06-18 09:51:36 -0600 | [diff] [blame] | 246 | if (!fInstanceRanges.empty()) { |
| 247 | fInstanceRanges.back().fEndInstanceIdx = resources->nextPathInstanceIdx(); |
| 248 | } |
| 249 | } |
| 250 | |
| 251 | inline void GrCCDrawPathsOp::recordInstance(const GrTextureProxy* atlasProxy, int instanceIdx) { |
| 252 | if (fInstanceRanges.empty()) { |
| 253 | fInstanceRanges.push_back({atlasProxy, instanceIdx}); |
| 254 | return; |
| 255 | } |
| 256 | if (fInstanceRanges.back().fAtlasProxy != atlasProxy) { |
| 257 | fInstanceRanges.back().fEndInstanceIdx = instanceIdx; |
| 258 | fInstanceRanges.push_back({atlasProxy, instanceIdx}); |
| 259 | return; |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame] | 260 | } |
| 261 | } |
| 262 | |
| 263 | void GrCCDrawPathsOp::onExecute(GrOpFlushState* flushState) { |
Chris Dalton | d7e2227 | 2018-05-23 10:17:17 -0600 | [diff] [blame] | 264 | SkASSERT(fOwningPerOpListPaths); |
Chris Dalton | f104fec | 2018-05-22 16:17:48 -0600 | [diff] [blame] | 265 | |
Chris Dalton | d7e2227 | 2018-05-23 10:17:17 -0600 | [diff] [blame] | 266 | const GrCCPerFlushResources* resources = fOwningPerOpListPaths->fFlushResources.get(); |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame] | 267 | if (!resources) { |
| 268 | return; // Setup failed. |
| 269 | } |
| 270 | |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame] | 271 | GrPipeline::InitArgs initArgs; |
| 272 | initArgs.fFlags = fSRGBFlags; |
| 273 | initArgs.fProxy = flushState->drawOpArgs().fProxy; |
| 274 | initArgs.fCaps = &flushState->caps(); |
| 275 | initArgs.fResourceProvider = flushState->resourceProvider(); |
| 276 | initArgs.fDstProxy = flushState->drawOpArgs().fDstProxy; |
| 277 | GrPipeline pipeline(initArgs, std::move(fProcessors), flushState->detachAppliedClip()); |
| 278 | |
| 279 | int baseInstance = fBaseInstance; |
Chris Dalton | 4da7019 | 2018-06-18 09:51:36 -0600 | [diff] [blame] | 280 | SkASSERT(baseInstance >= 0); // Make sure setupResources() has been called. |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame] | 281 | |
Chris Dalton | 4c458b1 | 2018-06-16 17:22:59 -0600 | [diff] [blame] | 282 | for (const InstanceRange& range : fInstanceRanges) { |
| 283 | SkASSERT(range.fEndInstanceIdx > baseInstance); |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame] | 284 | |
Chris Dalton | 4c458b1 | 2018-06-16 17:22:59 -0600 | [diff] [blame] | 285 | GrCCPathProcessor pathProc(flushState->resourceProvider(), sk_ref_sp(range.fAtlasProxy), |
Chris Dalton | 1c54894 | 2018-05-22 13:09:48 -0600 | [diff] [blame] | 286 | fViewMatrixIfUsingLocalCoords); |
Chris Dalton | 4da7019 | 2018-06-18 09:51:36 -0600 | [diff] [blame] | 287 | pathProc.drawPaths(flushState, pipeline, *resources, baseInstance, range.fEndInstanceIdx, |
| 288 | this->bounds()); |
Chris Dalton | 4c458b1 | 2018-06-16 17:22:59 -0600 | [diff] [blame] | 289 | |
| 290 | baseInstance = range.fEndInstanceIdx; |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame] | 291 | } |
Chris Dalton | 5ba36ba | 2018-05-09 01:08:38 -0600 | [diff] [blame] | 292 | } |