Have CCPR atlas generator run for all paths, ignore opsTaskIDs

This simplifies our world a lot, especially when reordering/merging
ops tasks. As noted in the comments, this assumes a full flush every
time but the successor – which is coming soon – won't rely on that.

Bug: skia:10877, skia:11948
Change-Id: I1843e80dfee8d7a868c6db4bae94bcd2cbfb5b78
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/403856
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
diff --git a/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp b/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp
index 21e158c..e89eea7 100644
--- a/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp
+++ b/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp
@@ -143,7 +143,7 @@
 }
 
 void GrCoverageCountingPathRenderer::preFlush(
-        GrOnFlushResourceProvider* onFlushRP, SkSpan<const uint32_t> taskIDs) {
+        GrOnFlushResourceProvider* onFlushRP, SkSpan<const uint32_t> /*taskIDs*/) {
     SkASSERT(!fFlushing);
     SkDEBUGCODE(fFlushing = true);
 
@@ -156,23 +156,22 @@
     specs.fMaxPreferredTextureSize = maxPreferredRTSize;
     specs.fMinTextureSize = std::min(512, maxPreferredRTSize);
 
-    // Move the per-opsTask paths that are about to be flushed from fPendingPaths to flushingPaths,
+    // Move the path lists from fPendingPaths to flushingPaths,
     // and count them up so we can preallocate buffers.
+    // NOTE: This assumes a full flush, as opposed to partial flush. This CCPR atlasing technique
+    // is on its way out, though. skbug.com/11948
+    // Also, this temporary array could go away but the ClipMapsIter code would get a whole lot
+    // messier. Leave it be.
     SkSTArray<8, sk_sp<GrCCPerOpsTaskPaths>> flushingPaths;
-    flushingPaths.reserve_back(taskIDs.count());
-    for (uint32_t taskID : taskIDs) {
-        auto iter = fPendingPaths.find(taskID);
-        if (fPendingPaths.end() == iter) {
-            continue;  // No paths on this opsTask.
-        }
-
-        flushingPaths.push_back(std::move(iter->second));
-        fPendingPaths.erase(iter);
+    flushingPaths.reserve_back(fPendingPaths.size());
+    for (auto& [taskID, paths] : fPendingPaths) {
+        flushingPaths.push_back(std::move(paths));
 
         for (const auto& clipsIter : flushingPaths.back()->fClipPaths) {
             clipsIter.second->accountForOwnPath(&specs);
         }
     }
+    fPendingPaths.clear();
 
     GrCCPerFlushResources perFlushResources(onFlushRP, specs);