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 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
655 } | 655 } |
656 | 656 |
657 /////////////////////////////////////////////////////////////////////////////// | 657 /////////////////////////////////////////////////////////////////////////////// |
658 | 658 |
659 #ifdef SK_DEBUG | 659 #ifdef SK_DEBUG |
660 | 660 |
661 void SkGlyphCache::validate() const { | 661 void SkGlyphCache::validate() const { |
662 #ifdef SK_DEBUG_GLYPH_CACHE | 662 #ifdef SK_DEBUG_GLYPH_CACHE |
663 int count = fGlyphArray.count(); | 663 int count = fGlyphArray.count(); |
664 for (int i = 0; i < count; i++) { | 664 for (int i = 0; i < count; i++) { |
665 const SkGlyph* glyph = fGlyphArray[i]; | 665 const SkGlyph* glyph = &fGlyphArray[i]; |
mtklein
2015/03/06 22:25:28
Might want to const SkGlyph& glyph and use '.' bel
| |
666 SkASSERT(glyph); | 666 SkASSERT(glyph); |
667 SkASSERT(fGlyphAlloc.contains(glyph)); | |
668 if (glyph->fImage) { | 667 if (glyph->fImage) { |
669 SkASSERT(fGlyphAlloc.contains(glyph->fImage)); | 668 SkASSERT(fGlyphAlloc.contains(glyph->fImage)); |
670 } | 669 } |
671 if (glyph->fDistanceField) { | |
672 SkASSERT(fGlyphAlloc.contains(glyph->fDistanceField)); | |
673 } | |
674 } | 670 } |
675 #endif | 671 #endif |
676 } | 672 } |
677 | 673 |
678 void SkGlyphCache_Globals::validate() const { | 674 void SkGlyphCache_Globals::validate() const { |
679 size_t computedBytes = 0; | 675 size_t computedBytes = 0; |
680 int computedCount = 0; | 676 int computedCount = 0; |
681 | 677 |
682 const SkGlyphCache* head = fHead; | 678 const SkGlyphCache* head = fHead; |
683 while (head != NULL) { | 679 while (head != NULL) { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
731 return tls ? tls->getCacheSizeLimit() : 0; | 727 return tls ? tls->getCacheSizeLimit() : 0; |
732 } | 728 } |
733 | 729 |
734 void SkGraphics::SetTLSFontCacheLimit(size_t bytes) { | 730 void SkGraphics::SetTLSFontCacheLimit(size_t bytes) { |
735 if (0 == bytes) { | 731 if (0 == bytes) { |
736 SkGlyphCache_Globals::DeleteTLS(); | 732 SkGlyphCache_Globals::DeleteTLS(); |
737 } else { | 733 } else { |
738 SkGlyphCache_Globals::GetTLS().setCacheSizeLimit(bytes); | 734 SkGlyphCache_Globals::GetTLS().setCacheSizeLimit(bytes); |
739 } | 735 } |
740 } | 736 } |
OLD | NEW |