Add GrResourceCache2.

Currently it just replaces GrGpu as the owner of the linked list of resources.

Committed: https://skia.googlesource.com/skia/+/94ce9ac8624dbb45656b8f5c992fad9c9ff3ee5f

R=mtklein@google.com, robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/481443002
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp
index e7daa6b..418f591 100644
--- a/src/gpu/gl/GrGpuGL.cpp
+++ b/src/gpu/gl/GrGpuGL.cpp
@@ -164,9 +164,15 @@
 
     // This must be called by before the GrDrawTarget destructor
     this->releaseGeometry();
-    // This subclass must do this before the base class destructor runs
-    // since we will unref the GrGLInterface.
-    this->releaseResources();
+}
+
+void GrGpuGL::contextAbandonded() {
+    INHERITED::contextAbandonded();
+    fProgramCache->abandon();
+    fHWProgramID = 0;
+    if (this->glCaps().pathRenderingSupport()) {
+        this->glPathRendering()->abandonGpuResources();
+    }
 }
 
 ///////////////////////////////////////////////////////////////////////////////