| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 | 10 |
| 11 #include "SkTypefaceCache.h" | 11 #include "SkTypefaceCache.h" |
| 12 #include "SkAtomics.h" | 12 #include "SkThread.h" |
| 13 #include "SkMutex.h" | |
| 14 | 13 |
| 15 #define TYPEFACE_CACHE_LIMIT 1024 | 14 #define TYPEFACE_CACHE_LIMIT 1024 |
| 16 | 15 |
| 17 SkTypefaceCache::SkTypefaceCache() {} | 16 SkTypefaceCache::SkTypefaceCache() {} |
| 18 | 17 |
| 19 SkTypefaceCache::~SkTypefaceCache() { | 18 SkTypefaceCache::~SkTypefaceCache() { |
| 20 const Rec* curr = fArray.begin(); | 19 const Rec* curr = fArray.begin(); |
| 21 const Rec* stop = fArray.end(); | 20 const Rec* stop = fArray.end(); |
| 22 while (curr < stop) { | 21 while (curr < stop) { |
| 23 curr->fFace->unref(); | 22 curr->fFace->unref(); |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 return false; | 108 return false; |
| 110 } | 109 } |
| 111 #endif | 110 #endif |
| 112 | 111 |
| 113 void SkTypefaceCache::Dump() { | 112 void SkTypefaceCache::Dump() { |
| 114 #ifdef SK_DEBUG | 113 #ifdef SK_DEBUG |
| 115 SkAutoMutexAcquire ama(gMutex); | 114 SkAutoMutexAcquire ama(gMutex); |
| 116 (void)Get().findByProcAndRef(DumpProc, NULL); | 115 (void)Get().findByProcAndRef(DumpProc, NULL); |
| 117 #endif | 116 #endif |
| 118 } | 117 } |
| OLD | NEW |