Use presence of a content key as non-scratch indicator
BUG=skia:2889
Committed: https://skia.googlesource.com/skia/+/9eefe0851eeaa8ded05b4774ebcb38ed201d5dbf
Review URL: https://codereview.chromium.org/639873002
diff --git a/src/gpu/GrResourceCache2.cpp b/src/gpu/GrResourceCache2.cpp
index 85e66a7..5144c59 100644
--- a/src/gpu/GrResourceCache2.cpp
+++ b/src/gpu/GrResourceCache2.cpp
@@ -67,15 +67,15 @@
// either by drawing code or for pending io operations.
// This will be removed when flush no longer creates resources.
return resource->reffedOnlyByCache() && !resource->internalHasPendingIO() &&
- GrGpuResource::kYes_IsScratch == resource->fIsScratch;
+ resource->isScratch();
} else {
// Because duties are currently shared between GrResourceCache and GrResourceCache2, the
// current interpretation of this rule is that only GrResourceCache has a ref but that
// it has been marked as a scratch resource.
- return resource->reffedOnlyByCache() &&
- GrGpuResource::kYes_IsScratch == resource->fIsScratch;
+ return resource->reffedOnlyByCache() && resource->isScratch();
}
}
+
private:
bool fFlushing;
};