Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(656)

Unified Diff: src/lazy/SkLruImageCache.cpp

Issue 12398021: If Ashmem cache fails pinCache, do not reallocate. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix an old type Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/lazy/SkLruImageCache.cpp
diff --git a/src/lazy/SkLruImageCache.cpp b/src/lazy/SkLruImageCache.cpp
index 62e29535966e8674acbe3cae3999dfeb8adca68a..342a3e5496d0f222f43930206f8f0cda48c05a86 100644
--- a/src/lazy/SkLruImageCache.cpp
+++ b/src/lazy/SkLruImageCache.cpp
@@ -131,7 +131,6 @@ void SkLruImageCache::releaseCache(intptr_t ID) {
}
void SkLruImageCache::throwAwayCache(intptr_t ID) {
- SkASSERT(ID != SkImageCache::UNINITIALIZED_ID);
SkAutoMutexAcquire ac(&fMutex);
CachedPixels* pixels = this->findByID(ID);
if (pixels != NULL) {
@@ -154,6 +153,9 @@ void SkLruImageCache::removePixels(CachedPixels* pixels) {
CachedPixels* SkLruImageCache::findByID(intptr_t ID) const {
// Mutex is already locked.
+ if (SkImageCache::UNINITIALIZED_ID == ID) {
+ return NULL;
+ }
Iter iter;
// Start from the head, most recently used.
CachedPixels* pixels = iter.init(fLRU, Iter::kHead_IterStart);

Powered by Google App Engine
This is Rietveld 408576698