Change UnrefDDLTask to just be the DDLTask (take 2)
This includes:
https://skia-review.googlesource.com/c/skia/+/333576 (Fix UMR (valgrind) bug in GrDrawingManager)
Change-Id: I162aba033e75b47a96b4dfdd840ba2cb1f70e42c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334422
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrRenderTask.cpp b/src/gpu/GrRenderTask.cpp
index 2a0e915..460454a 100644
--- a/src/gpu/GrRenderTask.cpp
+++ b/src/gpu/GrRenderTask.cpp
@@ -257,19 +257,16 @@
}
bool GrRenderTask::isInstantiated() const {
- // Some renderTasks (e.g. GrTransferFromRenderTask) don't have any targets.
- if (0 == this->numTargets()) {
- return true;
- }
- GrSurfaceProxy* proxy = this->target(0).proxy();
+ for (const GrSurfaceProxyView& target : fTargets) {
+ GrSurfaceProxy* proxy = target.proxy();
+ if (!proxy->isInstantiated()) {
+ return false;
+ }
- if (!proxy->isInstantiated()) {
- return false;
- }
-
- GrSurface* surface = proxy->peekSurface();
- if (surface->wasDestroyed()) {
- return false;
+ GrSurface* surface = proxy->peekSurface();
+ if (surface->wasDestroyed()) {
+ return false;
+ }
}
return true;
@@ -291,10 +288,9 @@
if (!fTargets.empty()) {
SkDebugf("Targets: \n");
- for (int i = 0; i < fTargets.count(); ++i) {
- GrSurfaceProxy* proxy = fTargets[i].proxy();
- SkDebugf("[%d]: proxyID: %d - surfaceID: %d\n",
- i,
+ for (const GrSurfaceProxyView& target : fTargets) {
+ GrSurfaceProxy* proxy = target.proxy();
+ SkDebugf("proxyID: %d - surfaceID: %d\n",
proxy ? proxy->uniqueID().asUInt() : -1,
proxy && proxy->peekSurface()
? proxy->peekSurface()->uniqueID().asUInt()