diff options
author | 2013-03-04 21:38:50 +0000 | |
---|---|---|
committer | 2013-03-04 21:38:50 +0000 | |
commit | c75764ed4441a7a9ab5555824b7f5e7cc34ba368 (patch) | |
tree | 6aadb50a856ee312d577b38a8434c43830724af0 /src/lazy/SkLruImageCache.cpp | |
parent | a560d00ba5005ded8094a307ca41365bdf47cd50 (diff) |
If Ashmem cache fails pinCache, do not reallocate.
Review URL: https://codereview.chromium.org/12398021
git-svn-id: http://skia.googlecode.com/svn/trunk@7973 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/lazy/SkLruImageCache.cpp')
-rw-r--r-- | src/lazy/SkLruImageCache.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lazy/SkLruImageCache.cpp b/src/lazy/SkLruImageCache.cpp index 6beb8a479b..54f26fb5dc 100644 --- a/src/lazy/SkLruImageCache.cpp +++ b/src/lazy/SkLruImageCache.cpp @@ -133,7 +133,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) { @@ -156,6 +155,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); |