OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 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 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 // remove an unused atlas and its strike (if necessary) | 88 // remove an unused atlas and its strike (if necessary) |
89 void freeAtlasExceptFor(GrTextStrike*); | 89 void freeAtlasExceptFor(GrTextStrike*); |
90 | 90 |
91 // testing | 91 // testing |
92 int countStrikes() const { return fCache.getArray().count(); } | 92 int countStrikes() const { return fCache.getArray().count(); } |
93 const GrTextStrike* strikeAt(int index) const { | 93 const GrTextStrike* strikeAt(int index) const { |
94 return fCache.getArray()[index]; | 94 return fCache.getArray()[index]; |
95 } | 95 } |
96 GrTextStrike* getHeadStrike() const { return fHead; } | 96 GrTextStrike* getHeadStrike() const { return fHead; } |
97 | 97 |
98 #if GR_DEBUG | 98 #if SK_DEBUG |
99 void validate() const; | 99 void validate() const; |
100 #else | 100 #else |
101 void validate() const {} | 101 void validate() const {} |
102 #endif | 102 #endif |
103 | 103 |
104 private: | 104 private: |
105 friend class GrFontPurgeListener; | 105 friend class GrFontPurgeListener; |
106 | 106 |
107 class Key; | 107 class Key; |
108 GrTHashTable<GrTextStrike, Key, 8> fCache; | 108 GrTHashTable<GrTextStrike, Key, 8> fCache; |
109 // for LRU | 109 // for LRU |
110 GrTextStrike* fHead; | 110 GrTextStrike* fHead; |
111 GrTextStrike* fTail; | 111 GrTextStrike* fTail; |
112 | 112 |
113 GrGpu* fGpu; | 113 GrGpu* fGpu; |
114 GrAtlasMgr* fAtlasMgr; | 114 GrAtlasMgr* fAtlasMgr; |
115 | 115 |
116 | 116 |
117 GrTextStrike* generateStrike(GrFontScaler*, const Key&); | 117 GrTextStrike* generateStrike(GrFontScaler*, const Key&); |
118 inline void detachStrikeFromList(GrTextStrike*); | 118 inline void detachStrikeFromList(GrTextStrike*); |
119 }; | 119 }; |
120 | 120 |
121 #endif | 121 #endif |
OLD | NEW |