OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 #ifndef GrStencilAndCoverTextContext_DEFINED | 8 #ifndef GrStencilAndCoverTextContext_DEFINED |
9 #define GrStencilAndCoverTextContext_DEFINED | 9 #define GrStencilAndCoverTextContext_DEFINED |
10 | 10 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 int fTotalGlyphCount; | 86 int fTotalGlyphCount; |
87 SkAutoTUnref<GrPathRangeDraw> fDraw; | 87 SkAutoTUnref<GrPathRangeDraw> fDraw; |
88 SkAutoTUnref<const SkTextBlob> fFallbackTextBlob; | 88 SkAutoTUnref<const SkTextBlob> fFallbackTextBlob; |
89 mutable SkGlyphCache* fDetachedGlyphCache; | 89 mutable SkGlyphCache* fDetachedGlyphCache; |
90 mutable uint32_t fLastDrawnGlyphsID; | 90 mutable uint32_t fLastDrawnGlyphsID; |
91 mutable SkMatrix fLocalMatrixTemplate; | 91 mutable SkMatrix fLocalMatrixTemplate; |
92 }; | 92 }; |
93 | 93 |
94 // Text blobs/caches. | 94 // Text blobs/caches. |
95 | 95 |
96 class TextBlob : public SkTLList<TextRun> { | 96 class TextBlob : public SkTLList<TextRun, 1> { |
97 public: | 97 public: |
98 typedef SkTArray<uint32_t, true> Key; | 98 typedef SkTArray<uint32_t, true> Key; |
99 | 99 |
100 static const Key& GetKey(const TextBlob* blob) { return blob->key(); } | 100 static const Key& GetKey(const TextBlob* blob) { return blob->key(); } |
101 | 101 |
102 static uint32_t Hash(const Key& key) { | 102 static uint32_t Hash(const Key& key) { |
103 SkASSERT(key.count() > 1); // 1-length keys should be using the blob
-id hash map. | 103 SkASSERT(key.count() > 1); // 1-length keys should be using the blob
-id hash map. |
104 return SkChecksum::Murmur3(key.begin(), sizeof(uint32_t) * key.count
()); | 104 return SkChecksum::Murmur3(key.begin(), sizeof(uint32_t) * key.count
()); |
105 } | 105 } |
106 | 106 |
(...skipping 25 matching lines...) Expand all Loading... |
132 | 132 |
133 SkTHashMap<uint32_t, TextBlob*> fBlobIdCache; | 133 SkTHashMap<uint32_t, TextBlob*> fBlobIdCache; |
134 SkTHashTable<TextBlob*, const TextBlob::Key&, TextBlob> fBlobKeyCache; | 134 SkTHashTable<TextBlob*, const TextBlob::Key&, TextBlob> fBlobKeyCache; |
135 SkTInternalLList<TextBlob> fLRUList; | 135 SkTInternalLList<TextBlob> fLRUList; |
136 size_t fCacheSize; | 136 size_t fCacheSize; |
137 | 137 |
138 typedef GrTextContext INHERITED; | 138 typedef GrTextContext INHERITED; |
139 }; | 139 }; |
140 | 140 |
141 #endif | 141 #endif |
OLD | NEW |