Index: src/gpu/GrContext.cpp |
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp |
index c518a1c8ac0438456f692ff02fd4b35e64bddfd8..d2664c3b86524b018642e0f8b41bd012b5d8628c 100644 |
--- a/src/gpu/GrContext.cpp |
+++ b/src/gpu/GrContext.cpp |
@@ -1825,6 +1825,17 @@ 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::findAndRefCachedResource(const GrResourceKey& resourceKey) { |
+ GrCacheable* resource = fTextureCache->find(resourceKey); |
+ SkSafeRef(resource); |
+ return resource; |
+} |
+ |
/////////////////////////////////////////////////////////////////////////////// |
#if GR_CACHE_STATS |
void GrContext::printCacheStats() const { |