diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-05-05 19:21:16 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-05-05 19:21:16 +0000 |
commit | a8d28efa76c581b6c6a94f889f38e050a8d21679 (patch) | |
tree | d6b0104593ecc54ac9e61409674db95a4da217cc | |
parent | 7c334de50080b67c0a34a1dbb31f622e6fa45d42 (diff) | |
download | include-a8d28efa76c581b6c6a94f889f38e050a8d21679.tar.gz |
Allow custom resources in the GrContext's cache
Adds methods to GrContext for client code to store custom resources in
the cache.
BUG=skia:
R=bsalomon@google.com
Author: cdalton@nvidia.com
Review URL: https://codereview.chromium.org/261593009
git-svn-id: http://skia.googlecode.com/svn/trunk/include@14577 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | gpu/GrContext.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gpu/GrContext.h b/gpu/GrContext.h index 4d0a94e..195ab72 100644 --- a/gpu/GrContext.h +++ b/gpu/GrContext.h @@ -899,6 +899,17 @@ public: GrPathRendererChain::DrawType drawType = GrPathRendererChain::kColor_DrawType, GrPathRendererChain::StencilSupport* stencilSupport = NULL); + /** + * Stores a custom resource in the cache, based on the specified key. + */ + void addResourceToCache(const GrResourceKey&, GrCacheable*); + + /** + * Finds a resource in the cache, based on the specified key. This is intended for use in + * conjunction with addResourceToCache(). The return value will be NULL if not found. The + * caller must balance with a call to unref(). + */ + GrCacheable* findAndRefCachedResource(const GrResourceKey&); #if GR_CACHE_STATS void printCacheStats() const; |