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

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

Issue 98703002: Fix compilation with SK_ENABLE_INST_COUNT=1 (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years 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/SkLruImageCache.cpp ('k') | src/pdf/SkPDFFont.h » ('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 "SkThread.h" 8 #include "SkThread.h"
9 #include "SkPurgeableImageCache.h" 9 #include "SkPurgeableImageCache.h"
10 #include "SkPurgeableMemoryBlock.h" 10 #include "SkPurgeableMemoryBlock.h"
11 11
12 #ifdef SK_DEBUG 12 #ifdef SK_DEBUG
13 #include "SkTSearch.h" 13 #include "SkTSearch.h"
14 #endif 14 #endif
15 15
16 SK_DEFINE_INST_COUNT(SkPurgeableImageCache)
17 SK_DECLARE_STATIC_MUTEX(gPurgeableImageMutex); 16 SK_DECLARE_STATIC_MUTEX(gPurgeableImageMutex);
18 17
19 SkImageCache* SkPurgeableImageCache::Create() { 18 SkImageCache* SkPurgeableImageCache::Create() {
20 if (!SkPurgeableMemoryBlock::IsSupported()) { 19 if (!SkPurgeableMemoryBlock::IsSupported()) {
21 return NULL; 20 return NULL;
22 } 21 }
23 SkAutoMutexAcquire ac(&gPurgeableImageMutex); 22 SkAutoMutexAcquire ac(&gPurgeableImageMutex);
24 static SkPurgeableImageCache gCache; 23 static SkPurgeableImageCache gCache;
25 gCache.ref(); 24 gCache.ref();
26 return &gCache; 25 return &gCache;
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 void SkPurgeableImageCache::removeRec(intptr_t ID) { 150 void SkPurgeableImageCache::removeRec(intptr_t ID) {
152 #ifdef SK_DEBUG 151 #ifdef SK_DEBUG
153 int index = this->findRec(ID); 152 int index = this->findRec(ID);
154 SkASSERT(index >= 0); 153 SkASSERT(index >= 0);
155 fRecs.remove(index); 154 fRecs.remove(index);
156 #endif 155 #endif
157 SkPurgeableMemoryBlock* block = reinterpret_cast<SkPurgeableMemoryBlock*>(ID ); 156 SkPurgeableMemoryBlock* block = reinterpret_cast<SkPurgeableMemoryBlock*>(ID );
158 SkASSERT(!block->isPinned()); 157 SkASSERT(!block->isPinned());
159 SkDELETE(block); 158 SkDELETE(block);
160 } 159 }
OLDNEW
« no previous file with comments | « src/lazy/SkLruImageCache.cpp ('k') | src/pdf/SkPDFFont.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698