Add pre-Flush callback to GrDrawingManager (take 2)
This will allow internal systems (e.g., fonts & path renderers) to create pre-flush atlases.
Depends on: https://skia-review.googlesource.com/c/8988/ (Allow GrSurfaceProxy-derived classes to use flags when instantiating)
Change-Id: I7ffc1b69defda625b6d4311e96776de4cf2abb87
Reviewed-on: https://skia-review.googlesource.com/9903
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrRenderTargetOpList.cpp b/src/gpu/GrRenderTargetOpList.cpp
index 1c98353..8d47fff 100644
--- a/src/gpu/GrRenderTargetOpList.cpp
+++ b/src/gpu/GrRenderTargetOpList.cpp
@@ -70,14 +70,25 @@
}
}
}
+
+void GrRenderTargetOpList::validateTargetsSingleRenderTarget() const {
+ GrRenderTarget* rt = nullptr;
+ for (int i = 0; i < fRecordedOps.count(); ++i) {
+ if (!fRecordedOps[i].fOp) {
+ continue; // combined forward
+ }
+
+ if (!rt) {
+ rt = fRecordedOps[i].fRenderTarget.get();
+ } else {
+ SkASSERT(fRecordedOps[i].fRenderTarget.get() == rt);
+ }
+ }
+}
#endif
void GrRenderTargetOpList::prepareOps(GrOpFlushState* flushState) {
- // Semi-usually the GrOpLists are already closed at this point, but sometimes Ganesh
- // needs to flush mid-draw. In that case, the SkGpuDevice's GrOpLists won't be closed
- // but need to be flushed anyway. Closing such GrOpLists here will mean new
- // GrOpLists will be created to replace them if the SkGpuDevice(s) write to them again.
- this->makeClosed();
+ // MDB TODO: add SkASSERT(this->isClosed());
// Loop over the ops that haven't yet been prepared.
for (int i = 0; i < fRecordedOps.count(); ++i) {