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

Unified Diff: src/lazy/SkLruImageCache.cpp

Issue 12378075: Provide an option in bench_pictures to count pixel ram. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: 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..ce88cc1b718cf6269d662026261d4c38971c1388 100644
--- a/src/lazy/SkLruImageCache.cpp
+++ b/src/lazy/SkLruImageCache.cpp
@@ -168,7 +168,9 @@ CachedPixels* SkLruImageCache::findByID(intptr_t ID) const {
void SkLruImageCache::purgeIfNeeded() {
// Mutex is already locked.
- this->purgeTilAtOrBelow(fRamBudget);
+ if (fRamBudget > 0) {
+ this->purgeTilAtOrBelow(fRamBudget);
+ }
}
void SkLruImageCache::purgeTilAtOrBelow(size_t limit) {

Powered by Google App Engine
This is Rietveld 408576698