aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrContext.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-09-07 19:44:33 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-09-07 19:44:33 +0000
commit50a035ddbb068446645b0978f4c092dec87a1a02 (patch)
tree99e9534267ee9394d8a336301e37750c85b5e1a7 /src/gpu/GrContext.cpp
parent5fd07ec782faaf4b47cc5a15a911b320ae95bcb2 (diff)
Added explicit cache clearing
Diffstat (limited to 'src/gpu/GrContext.cpp')
-rw-r--r--src/gpu/GrContext.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index f91f4206c2..9b01eb27e2 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -494,6 +494,7 @@ void GrContext::addExistingTextureToCache(GrTexture* texture) {
// and it should still be locked
fTextureCache->unlock(texture->getCacheEntry());
+ this->purgeCache();
}
void GrContext::lockTexture(GrTexture* texture) {
@@ -519,6 +520,11 @@ void GrContext::unlockTexture(GrTexture* texture) {
}
fTextureCache->unlock(texture->getCacheEntry());
+ this->purgeCache();
+}
+
+void GrContext::purgeCache() {
+ fTextureCache->purgeAsNeeded();
}
GrTexture* GrContext::createUncachedTexture(const GrTextureDesc& descIn,