Remove intermediate flushes from the resource allocator
If this works out i.e. no regressions, we can cut down the
resource allocator API before rejiggering it for budget estimation
(dry run).
Bug: skia:10877
Change-Id: Ic6388cffc688789592ff3d6a946e5176dc4fd052
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/368806
Auto-Submit: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp
index 9b44856..0648771 100644
--- a/src/gpu/GrDrawingManager.cpp
+++ b/src/gpu/GrDrawingManager.cpp
@@ -217,7 +217,10 @@
GrResourceAllocator::AssignError error = GrResourceAllocator::AssignError::kNoError;
int numRenderTasksExecuted = 0;
- while (alloc.assign(&startIndex, &stopIndex, &error)) {
+ if (alloc.assign(&startIndex, &stopIndex, &error)) {
+ // TODO: If this always-execute-everything approach works out, remove the startIndex &
+ // stopIndex from the GrResourceProvider API and simplify.
+ SkASSERT(startIndex == 0 && stopIndex == fDAG.count());
if (GrResourceAllocator::AssignError::kFailedProxyInstantiation == error) {
for (int i = startIndex; i < stopIndex; ++i) {
GrRenderTask* renderTask = fDAG[i].get();