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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 GrTextStrike* fNext; | 55 GrTextStrike* fNext; |
56 | 56 |
57 private: | 57 private: |
58 class Key; | 58 class Key; |
59 GrTHashTable<GrGlyph, Key, 7> fCache; | 59 GrTHashTable<GrGlyph, Key, 7> fCache; |
60 const GrKey* fFontScalerKey; | 60 const GrKey* fFontScalerKey; |
61 GrTAllocPool<GrGlyph> fPool; | 61 GrTAllocPool<GrGlyph> fPool; |
62 | 62 |
63 GrFontCache* fFontCache; | 63 GrFontCache* fFontCache; |
64 GrAtlasMgr* fAtlasMgr; | 64 GrAtlasMgr* fAtlasMgr; |
| 65 GrMaskFormat fMaskFormat; |
| 66 bool fUseDistanceField; |
| 67 |
65 GrAtlas fAtlas; | 68 GrAtlas fAtlas; |
66 | 69 |
67 GrMaskFormat fMaskFormat; | |
68 | |
69 GrGlyph* generateGlyph(GrGlyph::PackedID packed, GrFontScaler* scaler); | 70 GrGlyph* generateGlyph(GrGlyph::PackedID packed, GrFontScaler* scaler); |
70 | 71 |
71 friend class GrFontCache; | 72 friend class GrFontCache; |
72 }; | 73 }; |
73 | 74 |
74 class GrFontCache { | 75 class GrFontCache { |
75 public: | 76 public: |
76 GrFontCache(GrGpu*); | 77 GrFontCache(GrGpu*); |
77 ~GrFontCache(); | 78 ~GrFontCache(); |
78 | 79 |
79 inline GrTextStrike* getStrike(GrFontScaler*); | 80 inline GrTextStrike* getStrike(GrFontScaler*, bool useDistanceField); |
80 | 81 |
81 void freeAll(); | 82 void freeAll(); |
82 | 83 |
83 void purgeExceptFor(GrTextStrike*); | 84 void purgeExceptFor(GrTextStrike*); |
84 | 85 |
85 // remove an unused plot and its strike (if necessary) | 86 // remove an unused plot and its strike (if necessary) |
86 void freePlotExceptFor(GrTextStrike*); | 87 void freePlotExceptFor(GrTextStrike*); |
87 | 88 |
88 // testing | 89 // testing |
89 int countStrikes() const { return fCache.getArray().count(); } | 90 int countStrikes() const { return fCache.getArray().count(); } |
(...skipping 22 matching lines...) Expand all Loading... |
112 GrTextStrike* fTail; | 113 GrTextStrike* fTail; |
113 | 114 |
114 GrGpu* fGpu; | 115 GrGpu* fGpu; |
115 GrAtlasMgr* fAtlasMgr[kMaskFormatCount]; | 116 GrAtlasMgr* fAtlasMgr[kMaskFormatCount]; |
116 | 117 |
117 GrTextStrike* generateStrike(GrFontScaler*, const Key&); | 118 GrTextStrike* generateStrike(GrFontScaler*, const Key&); |
118 inline void detachStrikeFromList(GrTextStrike*); | 119 inline void detachStrikeFromList(GrTextStrike*); |
119 }; | 120 }; |
120 | 121 |
121 #endif | 122 #endif |
OLD | NEW |