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

Unified Diff: src/gpu/GrContext.cpp

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
« include/gpu/GrContext.h ('K') | « include/gpu/GrContext.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrContext.cpp
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index c518a1c8ac0438456f692ff02fd4b35e64bddfd8..71d55664efd08df0e1d45c368e22c43bd47339b8 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -1825,6 +1825,15 @@ GrPath* GrContext::createPath(const SkPath& inPath, const SkStrokeRec& stroke) {
return path;
}
+void GrContext::addResourceToCache(const GrResourceKey& resourceKey, GrCacheable* resource) {
+ fTextureCache->purgeAsNeeded(1, resource->gpuMemorySize());
+ fTextureCache->addResource(resourceKey, resource);
+}
+
+GrCacheable* GrContext::findCachedResource(const GrResourceKey& resourceKey) {
+ return fTextureCache->find(resourceKey);
+}
+
///////////////////////////////////////////////////////////////////////////////
#if GR_CACHE_STATS
void GrContext::printCacheStats() const {
« include/gpu/GrContext.h ('K') | « include/gpu/GrContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698