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