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