diff options
Diffstat (limited to 'src/gpu')
-rw-r--r-- | src/gpu/ccpr/GrCCPathParser.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gpu/ccpr/GrCCPathParser.cpp b/src/gpu/ccpr/GrCCPathParser.cpp index fd0b71da29..cb5311f3a1 100644 --- a/src/gpu/ccpr/GrCCPathParser.cpp +++ b/src/gpu/ccpr/GrCCPathParser.cpp @@ -262,23 +262,23 @@ void GrCCPathParser::discardParsedPath() { GrCCPathParser::CoverageCountBatchID GrCCPathParser::closeCurrentBatch() { SkASSERT(!fInstanceBuffer); SkASSERT(!fCoverageCountBatches.empty()); + const auto& lastBatch = fCoverageCountBatches.back(); - const auto& lastScissorSubBatch = fScissorSubBatches[lastBatch.fEndScissorSubBatchIdx - 1]; + int maxMeshes = 1 + fScissorSubBatches.count() - lastBatch.fEndScissorSubBatchIdx; + fMaxMeshesPerDraw = SkTMax(fMaxMeshesPerDraw, maxMeshes); + const auto& lastScissorSubBatch = fScissorSubBatches[lastBatch.fEndScissorSubBatchIdx - 1]; PrimitiveTallies batchTotalCounts = fTotalPrimitiveCounts[(int)ScissorMode::kNonScissored] - lastBatch.fEndNonScissorIndices; batchTotalCounts += fTotalPrimitiveCounts[(int)ScissorMode::kScissored] - lastScissorSubBatch.fEndPrimitiveIndices; + // This will invalidate lastBatch. fCoverageCountBatches.push_back() = { fTotalPrimitiveCounts[(int)ScissorMode::kNonScissored], fScissorSubBatches.count(), batchTotalCounts }; - - int maxMeshes = 1 + fScissorSubBatches.count() - lastBatch.fEndScissorSubBatchIdx; - fMaxMeshesPerDraw = SkTMax(fMaxMeshesPerDraw, maxMeshes); - return fCoverageCountBatches.count() - 1; } |