Added explicit cache clearing
http://codereview.appspot.com/6492094/
git-svn-id: http://skia.googlecode.com/svn/trunk@5444 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index f91f420..9b01eb2 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -494,6 +494,7 @@
// and it should still be locked
fTextureCache->unlock(texture->getCacheEntry());
+ this->purgeCache();
}
void GrContext::lockTexture(GrTexture* texture) {
@@ -519,6 +520,11 @@
}
fTextureCache->unlock(texture->getCacheEntry());
+ this->purgeCache();
+}
+
+void GrContext::purgeCache() {
+ fTextureCache->purgeAsNeeded();
}
GrTexture* GrContext::createUncachedTexture(const GrTextureDesc& descIn,