summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/jni/android/graphics/TextLayoutCache.cpp7
-rw-r--r--core/jni/android/graphics/TextLayoutCache.h2
2 files changed, 5 insertions, 4 deletions
diff --git a/core/jni/android/graphics/TextLayoutCache.cpp b/core/jni/android/graphics/TextLayoutCache.cpp
index 7abfcf1efaa5..8032ed81b65b 100644
--- a/core/jni/android/graphics/TextLayoutCache.cpp
+++ b/core/jni/android/graphics/TextLayoutCache.cpp
@@ -78,8 +78,10 @@ void TextLayoutCache::operator()(TextLayoutCacheKey& text, sp<TextLayoutValue>&
/*
* Cache clearing
*/
-void TextLayoutCache::clear() {
+void TextLayoutCache::purgeCaches() {
+ AutoMutex _l(mLock);
mCache.clear();
+ mShaper->purgeCaches();
}
/*
@@ -965,8 +967,7 @@ sp<TextLayoutValue> TextLayoutEngine::getValue(const SkPaint* paint, const jchar
void TextLayoutEngine::purgeCaches() {
#if USE_TEXT_LAYOUT_CACHE
- mTextLayoutCache->clear();
- mShaper->purgeCaches();
+ mTextLayoutCache->purgeCaches();
#if DEBUG_GLYPHS
ALOGD("Purged TextLayoutEngine caches");
#endif
diff --git a/core/jni/android/graphics/TextLayoutCache.h b/core/jni/android/graphics/TextLayoutCache.h
index 64b33a0a2c3d..1f4e22c8274f 100644
--- a/core/jni/android/graphics/TextLayoutCache.h
+++ b/core/jni/android/graphics/TextLayoutCache.h
@@ -276,7 +276,7 @@ public:
/**
* Clear the cache
*/
- void clear();
+ void purgeCaches();
private:
TextLayoutShaper* mShaper;