| 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 10 matching lines...) Expand all Loading... |
| 21 class GrFontCache; | 21 class GrFontCache; |
| 22 class GrGpu; | 22 class GrGpu; |
| 23 class GrFontPurgeListener; | 23 class GrFontPurgeListener; |
| 24 | 24 |
| 25 /** | 25 /** |
| 26 * The textcache maps a hostfontscaler instance to a dictionary of | 26 * The textcache maps a hostfontscaler instance to a dictionary of |
| 27 * glyphid->strike | 27 * glyphid->strike |
| 28 */ | 28 */ |
| 29 class GrTextStrike { | 29 class GrTextStrike { |
| 30 public: | 30 public: |
| 31 GrTextStrike(GrFontCache*, const GrKey* fontScalerKey, GrMaskFormat, GrAtlas
*); | 31 GrTextStrike(GrFontCache*, const GrFontDescKey* fontScalerKey, GrMaskFormat,
GrAtlas*); |
| 32 ~GrTextStrike(); | 32 ~GrTextStrike(); |
| 33 | 33 |
| 34 const GrKey* getFontScalerKey() const { return fFontScalerKey; } | 34 const GrFontDescKey* getFontScalerKey() const { return fFontScalerKey; } |
| 35 GrFontCache* getFontCache() const { return fFontCache; } | 35 GrFontCache* getFontCache() const { return fFontCache; } |
| 36 GrMaskFormat getMaskFormat() const { return fMaskFormat; } | 36 GrMaskFormat getMaskFormat() const { return fMaskFormat; } |
| 37 | 37 |
| 38 inline GrGlyph* getGlyph(GrGlyph::PackedID, GrFontScaler*); | 38 inline GrGlyph* getGlyph(GrGlyph::PackedID, GrFontScaler*); |
| 39 bool addGlyphToAtlas(GrGlyph*, GrFontScaler*); | 39 bool addGlyphToAtlas(GrGlyph*, GrFontScaler*); |
| 40 | 40 |
| 41 // testing | 41 // testing |
| 42 int countGlyphs() const { return fCache.getArray().count(); } | 42 int countGlyphs() const { return fCache.getArray().count(); } |
| 43 const GrGlyph* glyphAt(int index) const { | 43 const GrGlyph* glyphAt(int index) const { |
| 44 return fCache.getArray()[index]; | 44 return fCache.getArray()[index]; |
| 45 } | 45 } |
| 46 | 46 |
| 47 // remove any references to this plot | 47 // remove any references to this plot |
| 48 void removePlot(const GrPlot* plot); | 48 void removePlot(const GrPlot* plot); |
| 49 | 49 |
| 50 public: | 50 public: |
| 51 // for easy removal from list | 51 // for easy removal from list |
| 52 GrTextStrike* fPrev; | 52 GrTextStrike* fPrev; |
| 53 GrTextStrike* fNext; | 53 GrTextStrike* fNext; |
| 54 | 54 |
| 55 private: | 55 private: |
| 56 class Key; | 56 class Key; |
| 57 GrTHashTable<GrGlyph, Key, 7> fCache; | 57 GrTHashTable<GrGlyph, Key, 7> fCache; |
| 58 const GrKey* fFontScalerKey; | 58 const GrFontDescKey* fFontScalerKey; |
| 59 GrTAllocPool<GrGlyph> fPool; | 59 GrTAllocPool<GrGlyph> fPool; |
| 60 | 60 |
| 61 GrFontCache* fFontCache; | 61 GrFontCache* fFontCache; |
| 62 GrAtlas* fAtlas; | 62 GrAtlas* fAtlas; |
| 63 GrMaskFormat fMaskFormat; | 63 GrMaskFormat fMaskFormat; |
| 64 bool fUseDistanceField; | 64 bool fUseDistanceField; |
| 65 | 65 |
| 66 GrAtlas::ClientPlotUsage fPlotUsage; | 66 GrAtlas::ClientPlotUsage fPlotUsage; |
| 67 | 67 |
| 68 GrGlyph* generateGlyph(GrGlyph::PackedID packed, GrFontScaler* scaler); | 68 GrGlyph* generateGlyph(GrGlyph::PackedID packed, GrFontScaler* scaler); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 | 125 |
| 126 GrGpu* fGpu; | 126 GrGpu* fGpu; |
| 127 GrAtlas* fAtlases[kAtlasCount]; | 127 GrAtlas* fAtlases[kAtlasCount]; |
| 128 | 128 |
| 129 GrTextStrike* generateStrike(GrFontScaler*, const Key&); | 129 GrTextStrike* generateStrike(GrFontScaler*, const Key&); |
| 130 inline void detachStrikeFromList(GrTextStrike*); | 130 inline void detachStrikeFromList(GrTextStrike*); |
| 131 void purgeStrike(GrTextStrike* strike); | 131 void purgeStrike(GrTextStrike* strike); |
| 132 }; | 132 }; |
| 133 | 133 |
| 134 #endif | 134 #endif |
| OLD | NEW |