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 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 const SkDescriptor* desc, | 538 const SkDescriptor* desc, |
539 bool (*proc)(const SkGlyphCache*, void*), | 539 bool (*proc)(const SkGlyphCache*, void*), |
540 void* context) { | 540 void* context) { |
541 if (!typeface) { | 541 if (!typeface) { |
542 typeface = SkTypeface::GetDefaultTypeface(); | 542 typeface = SkTypeface::GetDefaultTypeface(); |
543 } | 543 } |
544 SkASSERT(desc); | 544 SkASSERT(desc); |
545 | 545 |
546 // Precondition: the typeface id must be the fFontID in the descriptor | 546 // Precondition: the typeface id must be the fFontID in the descriptor |
547 SkDEBUGCODE( | 547 SkDEBUGCODE( |
548 uint32_t length; | 548 uint32_t length = 0; |
549 const SkScalerContext::Rec* rec = static_cast<const SkScalerContext::Rec
*>( | 549 const SkScalerContext::Rec* rec = static_cast<const SkScalerContext::Rec
*>( |
550 desc->findEntry(kRec_SkDescriptorTag, &length)); | 550 desc->findEntry(kRec_SkDescriptorTag, &length)); |
551 SkASSERT(rec); | 551 SkASSERT(rec); |
552 SkASSERT(length == sizeof(*rec)); | 552 SkASSERT(length == sizeof(*rec)); |
553 SkASSERT(typeface->uniqueID() == rec->fFontID); | 553 SkASSERT(typeface->uniqueID() == rec->fFontID); |
554 ) | 554 ) |
555 | 555 |
556 SkGlyphCache_Globals& globals = get_globals(); | 556 SkGlyphCache_Globals& globals = get_globals(); |
557 SkGlyphCache* cache; | 557 SkGlyphCache* cache; |
558 | 558 |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
850 } | 850 } |
851 | 851 |
852 void SkGraphics::PurgeFontCache() { | 852 void SkGraphics::PurgeFontCache() { |
853 get_globals().purgeAll(); | 853 get_globals().purgeAll(); |
854 SkTypefaceCache::PurgeAll(); | 854 SkTypefaceCache::PurgeAll(); |
855 } | 855 } |
856 | 856 |
857 // TODO(herb): clean up TLS apis. | 857 // TODO(herb): clean up TLS apis. |
858 size_t SkGraphics::GetTLSFontCacheLimit() { return 0; } | 858 size_t SkGraphics::GetTLSFontCacheLimit() { return 0; } |
859 void SkGraphics::SetTLSFontCacheLimit(size_t bytes) { } | 859 void SkGraphics::SetTLSFontCacheLimit(size_t bytes) { } |
OLD | NEW |