Add a isDDLTarget flag to GrSurfaceProxy

With repositionable DDLs the surface proxies they target need
special handling (i.e., their backing resource size cannot
be known ahead of time).

I'll follow this up with a CL that removes the DDLTarget system from
the GrDrawingManager. AFAICT it is not longer needed.

Change-Id: I0d9189b94726fdf356d54c16de32d7e52e0d1451
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/352116
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp
index d6eee6c..49c63e4 100644
--- a/src/gpu/GrDrawingManager.cpp
+++ b/src/gpu/GrDrawingManager.cpp
@@ -104,6 +104,8 @@
         access == SkSurface::BackendSurfaceAccess::kNoAccess && !newState) {
         bool allUnused = std::all_of(proxies.begin(), proxies.end(), [&](GrSurfaceProxy* proxy) {
             bool used = std::any_of(fDAG.begin(), fDAG.end(), [&](auto& task) {
+                // TODO: the DDLTask should now just return true here instead of
+                // needing GrDrawingManager::isDDLTarget.
                 return task && task->isUsed(proxy);
             });
             return !used && !this->isDDLTarget(proxy);
@@ -686,6 +688,11 @@
 }
 #endif
 
+void GrDrawingManager::addDDLTarget(GrSurfaceProxy* newTarget, GrRenderTargetProxy* ddlTarget) {
+    SkASSERT(ddlTarget->isDDLTarget());
+    fDDLTargets.set(newTarget->uniqueID().asUInt(), ddlTarget);
+}
+
 void GrDrawingManager::closeActiveOpsTask() {
     if (fActiveOpsTask) {
         // This is a temporary fix for the partial-MDB world. In that world we're not