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/GrResourceCache2.h b/src/gpu/GrResourceCache2.h
new file mode 100644
index 0000000..1262c80
--- /dev/null
+++ b/src/gpu/GrResourceCache2.h
@@ -0,0 +1,40 @@
+
+/*
+ * Copyright 2014 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef GrResourceCache2_DEFINED
+#define GrResourceCache2_DEFINED
+
+#include "GrTypes.h"
+#include "SkTInternalLList.h"
+
+class GrGpuResource;
+
+/**
+ *  Eventual replacement for GrResourceCache. Currently it simply holds a list
+ *  of all GrGpuResource objects for a GrContext. It is used to invalidate all
+ *  the resources when necessary.
+ */
+class GrResourceCache2 {
+public:
+    GrResourceCache2() : fCount(0) {};
+    ~GrResourceCache2();
+
+    void insertResource(GrGpuResource* resource);
+
+    void removeResource(GrGpuResource* resource);
+
+    void abandonAll();
+
+    void releaseAll();
+
+private:
+    int                             fCount;
+    SkTInternalLList<GrGpuResource> fResources;
+};
+
+#endif