Add a work indication to SkDeferredDisplayList::ProgramIterator::compile
Chrome hopes to use this as a heuristic for when to yield. I.e., if no work is done, keep going but yield after each compile that did work.
Change-Id: I9524ca03078af3cd60f0042b2e8b0ec4c628e5f2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288176
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrContextPriv.cpp b/src/gpu/GrContextPriv.cpp
index 0c6eb1d..702d82d 100644
--- a/src/gpu/GrContextPriv.cpp
+++ b/src/gpu/GrContextPriv.cpp
@@ -69,13 +69,13 @@
fContext->drawingManager()->copyRenderTasksFromDDL(ddl, newDest);
}
-void GrContextPriv::compile(const GrProgramDesc& desc, const GrProgramInfo& info) {
+bool GrContextPriv::compile(const GrProgramDesc& desc, const GrProgramInfo& info) {
GrGpu* gpu = this->getGpu();
if (!gpu) {
- return;
+ return false;
}
- gpu->compile(desc, info);
+ return gpu->compile(desc, info);
}