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

Side by Side Diff: src/lazy/SkLruImageCache.cpp

Issue 18461007: Fix two leaks & improve leak tracking (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/lazy/SkBitmapFactory.cpp ('k') | src/lazy/SkPurgeableImageCache.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkLruImageCache.h" 8 #include "SkLruImageCache.h"
9 9
10 SK_DEFINE_INST_COUNT(SkImageCache)
11 SK_DEFINE_INST_COUNT(SkLruImageCache)
12
10 static intptr_t NextGenerationID() { 13 static intptr_t NextGenerationID() {
11 static intptr_t gNextID; 14 static intptr_t gNextID;
12 do { 15 do {
13 gNextID++; 16 gNextID++;
14 } while (SkImageCache::UNINITIALIZED_ID == gNextID); 17 } while (SkImageCache::UNINITIALIZED_ID == gNextID);
15 return gNextID; 18 return gNextID;
16 } 19 }
17 20
18 class CachedPixels : public SkNoncopyable { 21 class CachedPixels : public SkNoncopyable {
19 22
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 CachedPixels* pixels = iter.init(fLRU, Iter::kTail_IterStart); 197 CachedPixels* pixels = iter.init(fLRU, Iter::kTail_IterStart);
195 while (pixels != NULL && fRamUsed > limit) { 198 while (pixels != NULL && fRamUsed > limit) {
196 CachedPixels* prev = iter.prev(); 199 CachedPixels* prev = iter.prev();
197 if (!pixels->isLocked()) { 200 if (!pixels->isLocked()) {
198 this->removePixels(pixels); 201 this->removePixels(pixels);
199 } 202 }
200 pixels = prev; 203 pixels = prev;
201 } 204 }
202 } 205 }
203 } 206 }
OLDNEW
« no previous file with comments | « src/lazy/SkBitmapFactory.cpp ('k') | src/lazy/SkPurgeableImageCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698