Revert "Merge adjacent GrOpsTasks with same target together"

This reverts commit 3b5b7d1178143b2292df9e37a0af27fba6ad2514.

Reason for revert: Arenas cant be moved

Original change's description:
> Merge adjacent GrOpsTasks with same target together
>
> This allows the ops tasks to make one render pass instead of multiple.
> The only case where this merging is needed is as a result of
> reordering (reduceOpsTaskSplitting).
>
> Bug: skia:10877
> Change-Id: Ia967ead6efc43f7d2c1da58f770d3987da690cda
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353656
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Adlai Holler <adlai@google.com>

TBR=egdaniel@google.com,robertphillips@google.com,adlai@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: skia:10877
Change-Id: I6d1813ee1c28bc43dffb0a5f26dba4a5c41c637f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/358522
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp
index b185589..69f93e4 100644
--- a/src/gpu/GrDrawingManager.cpp
+++ b/src/gpu/GrDrawingManager.cpp
@@ -424,20 +424,17 @@
 }
 
 // Reorder the array to match the llist without reffing & unreffing sk_sp's.
-// The llist must contain a subset of the entries in the array.
+// Both args must contain the same objects.
 // This is basically a shim because clustering uses LList but the rest of drawmgr uses array.
-// Pointers in the array are not dereferenced.
 template <typename T>
 static void reorder_array_by_llist(const SkTInternalLList<T>& llist, SkTArray<sk_sp<T>>* array) {
-    for (sk_sp<T>& t : *array) {
-        [[maybe_unused]] T* old = t.release();
-    }
     int i = 0;
     for (T* t : llist) {
+        // Release the pointer that used to live here so it doesn't get unreffed.
+        [[maybe_unused]] T* old = array->at(i).release();
         array->at(i++).reset(t);
     }
-    SkASSERT(i <= array->count());
-    array->resize_back(i);
+    SkASSERT(i == array->count());
 }
 
 void GrDrawingManager::reorderTasks() {
@@ -449,30 +446,6 @@
     }
     // TODO: Handle case where proposed order would blow our memory budget.
     // Such cases are currently pathological, so we could just return here and keep current order.
-
-    // Merge adjacent ops tasks. Note: We remove (future) tasks from the list during iteration.
-    // This works out, however, because when we access the next element in llist it will be valid.
-    for (auto task : llist) {
-        auto opsTask = task->asOpsTask();
-        if (!opsTask) {
-            continue;
-        }
-
-        int removedCount = opsTask->mergeFromLList();
-        auto removedTask = opsTask->fNext;
-        for (int i = 0; i < removedCount; i++) {
-            auto next = removedTask->fNext;
-            llist.remove(removedTask);
-
-            // After this unref, there will be a dangling sk_sp to this task in fDAG somewhere.
-            // That dangling pointer will be removed in reorder_array_by_llist.
-            removedTask->disown(this);
-            removedTask->unref();
-
-            removedTask = next;
-        }
-    }
-
     reorder_array_by_llist(llist, &fDAG);
 }