| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
| 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 "SkGlyphCache.h" | 8 #include "SkGlyphCache.h" |
| 9 #include "SkGlyphCache_Globals.h" | 9 #include "SkGlyphCache_Globals.h" |
| 10 #include "SkGraphics.h" | 10 #include "SkGraphics.h" |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 | 522 |
| 523 SkGlyphCache_Globals& globals = get_globals(); | 523 SkGlyphCache_Globals& globals = get_globals(); |
| 524 SkGlyphCache* cache; | 524 SkGlyphCache* cache; |
| 525 | 525 |
| 526 { | 526 { |
| 527 Exclusive ac(globals.fLock); | 527 Exclusive ac(globals.fLock); |
| 528 | 528 |
| 529 globals.validate(); | 529 globals.validate(); |
| 530 | 530 |
| 531 for (cache = globals.internalGetHead(); cache != nullptr; cache = cache-
>fNext) { | 531 for (cache = globals.internalGetHead(); cache != nullptr; cache = cache-
>fNext) { |
| 532 if (cache->fDesc->equals(*desc)) { | 532 if (*cache->fDesc == *desc) { |
| 533 globals.internalDetachCache(cache); | 533 globals.internalDetachCache(cache); |
| 534 if (!proc(cache, context)) { | 534 if (!proc(cache, context)) { |
| 535 globals.internalAttachCacheToHead(cache); | 535 globals.internalAttachCacheToHead(cache); |
| 536 cache = nullptr; | 536 cache = nullptr; |
| 537 } | 537 } |
| 538 return cache; | 538 return cache; |
| 539 } | 539 } |
| 540 } | 540 } |
| 541 } | 541 } |
| 542 | 542 |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 817 } | 817 } |
| 818 | 818 |
| 819 void SkGraphics::PurgeFontCache() { | 819 void SkGraphics::PurgeFontCache() { |
| 820 get_globals().purgeAll(); | 820 get_globals().purgeAll(); |
| 821 SkTypefaceCache::PurgeAll(); | 821 SkTypefaceCache::PurgeAll(); |
| 822 } | 822 } |
| 823 | 823 |
| 824 // TODO(herb): clean up TLS apis. | 824 // TODO(herb): clean up TLS apis. |
| 825 size_t SkGraphics::GetTLSFontCacheLimit() { return 0; } | 825 size_t SkGraphics::GetTLSFontCacheLimit() { return 0; } |
| 826 void SkGraphics::SetTLSFontCacheLimit(size_t bytes) { } | 826 void SkGraphics::SetTLSFontCacheLimit(size_t bytes) { } |
| OLD | NEW |