Merge "Fix for b7155617 race condition in TextLayoutCache.cpp" into jb-mr1-dev

This commit is contained in:
Raph Levien
2012-09-12 15:44:58 -07:00
committed by Android (Google) Code Review
2 changed files with 5 additions and 4 deletions

View File

@@ -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

View File

@@ -276,7 +276,7 @@ public:
/**
* Clear the cache
*/
void clear();
void purgeCaches();
private:
TextLayoutShaper* mShaper;