aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2014-08-21 13:02:13 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-08-21 13:02:13 -0700
commitc8dc1f74b6cdda9a43a638292a608c59c1d72d80 (patch)
tree3a9aa5cba189d6d342520bde36f94abb3570d5c6 /include
parent78fc1dbed0216f3c85445b100331645a187c424f (diff)
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
Diffstat (limited to 'include')
-rw-r--r--include/gpu/GrContext.h3
-rw-r--r--include/gpu/GrGpuResource.h10
2 files changed, 9 insertions, 4 deletions
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index d6245100d6..4f9b642b23 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -35,6 +35,7 @@ class GrPath;
class GrPathRenderer;
class GrResourceEntry;
class GrResourceCache;
+class GrResourceCache2;
class GrStencilBuffer;
class GrTestTarget;
class GrTextContext;
@@ -926,6 +927,7 @@ public:
GrDrawTarget* getTextTarget();
const GrIndexBuffer* getQuadIndexBuffer() const;
GrAARectRenderer* getAARectRenderer() { return fAARectRenderer; }
+ GrResourceCache2* getResourceCache2() { return fResourceCache2; }
// Called by tests that draw directly to the context via GrDrawTarget
void getTestTarget(GrTestTarget*);
@@ -973,6 +975,7 @@ private:
GrDrawState* fDrawState;
GrResourceCache* fResourceCache;
+ GrResourceCache2* fResourceCache2;
GrFontCache* fFontCache;
SkAutoTDelete<GrLayerCache> fLayerCache;
diff --git a/include/gpu/GrGpuResource.h b/include/gpu/GrGpuResource.h
index 127f64b903..8b162823bf 100644
--- a/include/gpu/GrGpuResource.h
+++ b/include/gpu/GrGpuResource.h
@@ -12,6 +12,7 @@
#include "SkTInternalLList.h"
class GrResourceCacheEntry;
+class GrResourceCache2;
class GrGpu;
class GrContext;
@@ -118,12 +119,13 @@ private:
static uint32_t CreateUniqueID();
- // We're in an internal doubly linked list
+ // We're in an internal doubly linked list owned by GrResourceCache2
SK_DECLARE_INTERNAL_LLIST_INTERFACE(GrGpuResource);
- GrGpu* fGpu; // not reffed. The GrGpu can be deleted while there
- // are still live GrGpuResources. It will call
- // release() on all such objects in its destructor.
+ // This is not ref'ed but abandon() or release() will be called before the GrGpu object
+ // is destroyed. Those calls set will this to NULL.
+ GrGpu* fGpu;
+
enum Flags {
/**
* This object wraps a GPU object given to us by the user.