Use scratch keys for stencil buffers.

BUG=skia:2889

Committed: https://skia.googlesource.com/skia/+/91175f19664a62851da4ca4e0984a7c7c45b258f

Review URL: https://codereview.chromium.org/747043004
diff --git a/src/gpu/GrGpuResource.cpp b/src/gpu/GrGpuResource.cpp
index 8dbbd83..cc24335 100644
--- a/src/gpu/GrGpuResource.cpp
+++ b/src/gpu/GrGpuResource.cpp
@@ -128,6 +128,13 @@
     fScratchKey = scratchKey;
 }
 
+void GrGpuResource::removeScratchKey() {
+    if (!this->wasDestroyed() && !fScratchKey.isNullScratch()) {
+        get_resource_cache2(fGpu)->resourceAccess().willRemoveScratchKey(this);
+        fScratchKey = GrResourceKey::NullScratchKey();
+    }
+}
+
 uint32_t GrGpuResource::CreateUniqueID() {
     static int32_t gUniqueID = SK_InvalidUniqueID;
     uint32_t id;