commit | c75764ed4441a7a9ab5555824b7f5e7cc34ba368 | [log] [tgz] |
---|---|---|
author | scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | Mon Mar 04 21:38:50 2013 +0000 |
committer | scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | Mon Mar 04 21:38:50 2013 +0000 |
tree | 6aadb50a856ee312d577b38a8434c43830724af0 | |
parent | a560d00ba5005ded8094a307ca41365bdf47cd50 [diff] [blame] |
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
diff --git a/src/lazy/SkLazyPixelRef.cpp b/src/lazy/SkLazyPixelRef.cpp index a20b3c0..9ae22f2 100644 --- a/src/lazy/SkLazyPixelRef.cpp +++ b/src/lazy/SkLazyPixelRef.cpp
@@ -88,6 +88,8 @@ // FIXME: As an optimization, only do this part once. fErrorInDecoding = !fDecodeProc(fData->data(), fData->size(), &info, NULL); if (fErrorInDecoding) { + // In case a previous call to allocAndPinCache succeeded. + fImageCache->throwAwayCache(fCacheId); fCacheId = SkImageCache::UNINITIALIZED_ID; return NULL; }