Do reordering & memory budgeting after onFlushCB

This allows the CCPR atlas manager to setup its atlas before
we do any memory budgeting. That way the atlas size is known.

Bug: skia:10877
Change-Id: I9d73df29d1e8412b714b00dbf2ebff47025d3e3e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/403857
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This commit is contained in:
Adlai Holler 2021-05-04 10:00:30 -04:00 committed by Skia Commit-Bot
parent f5b03fcdd2
commit 566cf465fc

View File

@ -139,15 +139,6 @@ bool GrDrawingManager::flush(
this->sortTasks();
bool usingReorderedDAG = false;
GrResourceAllocator resourceAllocator(dContext);
if (fReduceOpsTaskSplitting) {
usingReorderedDAG = this->reorderTasks(&resourceAllocator);
if (!usingReorderedDAG) {
resourceAllocator.reset();
}
}
if (!fCpuBufferCache) {
// We cache more buffers when the backend is using client side arrays. Otherwise, we
// expect each pool will use a CPU buffer as a staging buffer before uploading to a GPU
@ -195,6 +186,15 @@ bool GrDrawingManager::flush(
}
}
bool usingReorderedDAG = false;
GrResourceAllocator resourceAllocator(dContext);
if (fReduceOpsTaskSplitting) {
usingReorderedDAG = this->reorderTasks(&resourceAllocator);
if (!usingReorderedDAG) {
resourceAllocator.reset();
}
}
#if 0
// Enable this to print out verbose GrOp information
SkDEBUGCODE(SkDebugf("onFlush renderTasks (%d):\n", fOnFlushRenderTasks.count()));