diff options
| author | 2012-09-12 15:44:58 -0700 | |
|---|---|---|
| committer | 2012-09-12 15:44:58 -0700 | |
| commit | eb1f5349f8ac51e12e48497bbd2ae37badfe5009 (patch) | |
| tree | 36b9007be9b46eb8a6e3bdaec92299d195b2edd7 | |
| parent | 4a86019aeeed8420c809b94ac07edeff86972108 (diff) | |
| parent | 13ba4e478d19001ddb6828bd1fd8fbc1e0cb208f (diff) | |
Merge "Fix for b7155617 race condition in TextLayoutCache.cpp" into jb-mr1-dev
| -rw-r--r-- | core/jni/android/graphics/TextLayoutCache.cpp | 7 | ||||
| -rw-r--r-- | core/jni/android/graphics/TextLayoutCache.h | 2 |
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; |