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 |
11 #ifndef GrTextStrike_DEFINED | 11 #ifndef GrTextStrike_DEFINED |
12 #define GrTextStrike_DEFINED | 12 #define GrTextStrike_DEFINED |
13 | 13 |
14 #include "GrAllocPool.h" | 14 #include "GrAllocPool.h" |
15 #include "GrFontScaler.h" | 15 #include "GrFontScaler.h" |
16 #include "GrTHashCache.h" | 16 #include "GrTHashCache.h" |
17 #include "GrPoint.h" | 17 #include "GrPoint.h" |
18 #include "GrGlyph.h" | 18 #include "GrGlyph.h" |
| 19 #include "GrDrawTarget.h" |
19 | 20 |
20 class GrAtlasMgr; | 21 class GrAtlasMgr; |
21 class GrFontCache; | 22 class GrFontCache; |
22 class GrGpu; | 23 class GrGpu; |
23 class GrFontPurgeListener; | 24 class GrFontPurgeListener; |
24 | 25 |
25 /** | 26 /** |
26 * The textcache maps a hostfontscaler instance to a dictionary of | 27 * The textcache maps a hostfontscaler instance to a dictionary of |
27 * glyphid->strike | 28 * glyphid->strike |
28 */ | 29 */ |
29 class GrTextStrike { | 30 class GrTextStrike { |
30 public: | 31 public: |
31 GrTextStrike(GrFontCache*, const GrKey* fontScalerKey, GrMaskFormat, | 32 GrTextStrike(GrFontCache*, const GrKey* fontScalerKey, GrMaskFormat, |
32 GrAtlasMgr*); | 33 GrAtlasMgr*); |
33 ~GrTextStrike(); | 34 ~GrTextStrike(); |
34 | 35 |
35 const GrKey* getFontScalerKey() const { return fFontScalerKey; } | 36 const GrKey* getFontScalerKey() const { return fFontScalerKey; } |
36 GrFontCache* getFontCache() const { return fFontCache; } | 37 GrFontCache* getFontCache() const { return fFontCache; } |
37 GrMaskFormat getMaskFormat() const { return fMaskFormat; } | 38 GrMaskFormat getMaskFormat() const { return fMaskFormat; } |
38 | 39 |
39 inline GrGlyph* getGlyph(GrGlyph::PackedID, GrFontScaler*); | 40 inline GrGlyph* getGlyph(GrGlyph::PackedID, GrFontScaler*); |
40 bool getGlyphAtlas(GrGlyph*, GrFontScaler*); | 41 bool getGlyphAtlas(GrGlyph*, GrFontScaler*, GrDrawTarget::DrawToken currentD
rawToken); |
41 | 42 |
42 // testing | 43 // testing |
43 int countGlyphs() const { return fCache.getArray().count(); } | 44 int countGlyphs() const { return fCache.getArray().count(); } |
44 const GrGlyph* glyphAt(int index) const { | 45 const GrGlyph* glyphAt(int index) const { |
45 return fCache.getArray()[index]; | 46 return fCache.getArray()[index]; |
46 } | 47 } |
47 GrAtlas* getAtlas() const { return fAtlas; } | 48 GrAtlas* getAtlas() const { return fAtlas; } |
48 | 49 |
49 // returns true if an atlas was removed | 50 // returns true if an atlas was removed |
50 bool removeUnusedAtlases(); | 51 bool removeUnusedAtlases(); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 | 112 |
112 GrGpu* fGpu; | 113 GrGpu* fGpu; |
113 GrAtlasMgr* fAtlasMgr; | 114 GrAtlasMgr* fAtlasMgr; |
114 | 115 |
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 }; | 119 }; |
119 | 120 |
120 #endif | 121 #endif |
OLD | NEW |