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

Unified Diff: include/gpu/GrContext.h

Issue 261593009: Allow custom resources in the GrContext's cache (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 8 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
« no previous file with comments | « no previous file | src/gpu/GrContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrContext.h
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index 4d0a94e4cda92682d59c1d83a6f23bb08805857b..07eea293ce1364bc7d5a562dd8c89e5d2a1edb40 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -899,6 +899,15 @@ public:
GrPathRendererChain::DrawType drawType = GrPathRendererChain::kColor_DrawType,
GrPathRendererChain::StencilSupport* stencilSupport = NULL);
+ /**
+ * Client code can store custom resources in the cache using
+ * addResourceToCache() and findCachedResource(). findCachedResource() does
+ * not modify the object's ref count, so the caller does not need to call
+ * unref().
bsalomon 2014/04/30 20:19:52 I think this has to ref the object to be safe. Wha
Chris Dalton 2014/04/30 21:11:29 Right, that wording is confusing come to think of
+ */
+ void addResourceToCache(const GrResourceKey&, GrCacheable*);
+ GrCacheable* findCachedResource(const GrResourceKey& key);
+
#if GR_CACHE_STATS
void printCacheStats() const;
« no previous file with comments | « no previous file | src/gpu/GrContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698