| 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 SK_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 |
| 81 #if SK_DISTANCEFIELD_FONTS |
| 82 inline GrTextStrike* getStrike(GrFontScaler*, bool useDistanceField); |
| 83 #else |
| 78 inline GrTextStrike* getStrike(GrFontScaler*); | 84 inline GrTextStrike* getStrike(GrFontScaler*); |
| 85 #endif |
| 79 | 86 |
| 80 void freeAll(); | 87 void freeAll(); |
| 81 | 88 |
| 82 void purgeExceptFor(GrTextStrike*); | 89 void purgeExceptFor(GrTextStrike*); |
| 83 | 90 |
| 84 // remove an unused plot and its strike (if necessary) | 91 // remove an unused plot and its strike (if necessary) |
| 85 void freePlotExceptFor(GrTextStrike*); | 92 void freePlotExceptFor(GrTextStrike*); |
| 86 | 93 |
| 87 // testing | 94 // testing |
| 88 int countStrikes() const { return fCache.getArray().count(); } | 95 int countStrikes() const { return fCache.getArray().count(); } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 112 | 119 |
| 113 GrGpu* fGpu; | 120 GrGpu* fGpu; |
| 114 GrAtlasMgr* fAtlasMgr[kMaskFormatCount]; | 121 GrAtlasMgr* fAtlasMgr[kMaskFormatCount]; |
| 115 | 122 |
| 116 GrTextStrike* generateStrike(GrFontScaler*, const Key&); | 123 GrTextStrike* generateStrike(GrFontScaler*, const Key&); |
| 117 inline void detachStrikeFromList(GrTextStrike*); | 124 inline void detachStrikeFromList(GrTextStrike*); |
| 118 void purgeStrike(GrTextStrike* strike); | 125 void purgeStrike(GrTextStrike* strike); |
| 119 }; | 126 }; |
| 120 | 127 |
| 121 #endif | 128 #endif |
| OLD | NEW |