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