Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Unified Diff: src/gpu/GrResourceCache2.h

Issue 481443002: Add GrResourceCache2. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove removeHead Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/gpu/GrResourceCache2.h
diff --git a/src/gpu/GrResourceCache2.h b/src/gpu/GrResourceCache2.h
new file mode 100644
index 0000000000000000000000000000000000000000..d2a0eb7f83a1b1fe81508bdd48405be935043567
--- /dev/null
+++ b/src/gpu/GrResourceCache2.h
@@ -0,0 +1,42 @@
+
+/*
+ * 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"
+
robertphillips 2014/08/15 19:36:17 Remove either the pre-decl or the #include ?
bsalomon 2014/08/19 15:16:08 Done.
+class GrGpuResource;
+
+#include "GrGpuResource.h"
+
+/**
+ * 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

Powered by Google App Engine
This is Rietveld 408576698