diff options
| author | 2010-08-24 17:20:20 -0700 | |
|---|---|---|
| committer | 2010-08-24 17:20:20 -0700 | |
| commit | a84e02ce3cc392ccf23bbe89cdfbef650047ffe7 (patch) | |
| tree | 6ddb05a329a031522ccd45c477d11556dfdb5ee1 /libs/hwui/GenerationCache.h | |
| parent | 17b4d9ea826609f26a73077975c2399f91b5ca36 (diff) | |
| parent | fb8b763f762ae21923c58d64caa729b012f40e05 (diff) | |
Merge "Use only one GL context per process, share chaches."
Diffstat (limited to 'libs/hwui/GenerationCache.h')
| -rw-r--r-- | libs/hwui/GenerationCache.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libs/hwui/GenerationCache.h b/libs/hwui/GenerationCache.h index 45b3ffaf074a..c358c8096cfd 100644 --- a/libs/hwui/GenerationCache.h +++ b/libs/hwui/GenerationCache.h @@ -104,12 +104,14 @@ void GenerationCache<K, V>::setOnEntryRemovedListener(OnEntryRemoved<K, V>* list template<typename K, typename V> void GenerationCache<K, V>::clear() { if (mListener) { - while (mCache.size() > 0) { - removeOldest(); + for (uint32_t i = 0; i < mCache.size(); i++) { + sp<Entry<K, V> > entry = mCache.valueAt(i); + if (mListener) { + (*mListener)(entry->key, entry->value); + } } - } else { - mCache.clear(); } + mCache.clear(); mYoungest.clear(); mOldest.clear(); } |