OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef GrBatchFontCache_DEFINED | 8 #ifndef GrBatchFontCache_DEFINED |
9 #define GrBatchFontCache_DEFINED | 9 #define GrBatchFontCache_DEFINED |
10 | 10 |
11 #include "GrBatchAtlas.h" | 11 #include "GrBatchAtlas.h" |
12 #include "GrFontScaler.h" | 12 #include "GrFontScaler.h" |
13 #include "GrGlyph.h" | 13 #include "GrGlyph.h" |
14 #include "SkTDynamicHash.h" | 14 #include "SkTDynamicHash.h" |
15 #include "SkVarAlloc.h" | 15 #include "SkVarAlloc.h" |
16 | 16 |
17 class GrBatchFontCache; | 17 class GrBatchFontCache; |
18 class GrBatchTarget; | 18 class GrBatchTarget; |
19 class GrGpu; | 19 class GrGpu; |
20 | 20 |
21 /** | 21 /** |
22 * The GrBatchTextStrike manages a pool of CPU backing memory for Glyph Masks.
This backing memory | 22 * The GrBatchTextStrike manages a pool of CPU backing memory for GrGlyphs. Th
is backing memory |
23 * is abstracted by GrGlyph, and indexed by a PackedID and GrFontScaler. The G
rFontScaler is what | 23 * is indexed by a PackedID and GrFontScaler. The GrFontScaler is what actuall
y creates the mask. |
24 * actually creates the mask. | |
25 */ | 24 */ |
26 class GrBatchTextStrike : public SkNVRefCnt<GrBatchTextStrike> { | 25 class GrBatchTextStrike : public SkNVRefCnt<GrBatchTextStrike> { |
27 public: | 26 public: |
28 GrBatchTextStrike(GrBatchFontCache*, const GrFontDescKey* fontScalerKey); | 27 GrBatchTextStrike(GrBatchFontCache*, const GrFontDescKey* fontScalerKey); |
29 ~GrBatchTextStrike(); | 28 ~GrBatchTextStrike(); |
30 | 29 |
31 const GrFontDescKey* getFontScalerKey() const { return fFontScalerKey; } | 30 const GrFontDescKey* getFontScalerKey() const { return fFontScalerKey; } |
32 GrBatchFontCache* getBatchFontCache() const { return fBatchFontCache; } | 31 GrBatchFontCache* getBatchFontCache() const { return fBatchFontCache; } |
33 | 32 |
34 inline GrGlyph* getGlyph(GrGlyph::PackedID packed, GrFontScaler* scaler) { | 33 inline GrGlyph* getGlyph(GrGlyph::PackedID packed, GrFontScaler* scaler) { |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 | 189 |
191 static void HandleEviction(GrBatchAtlas::AtlasID, void*); | 190 static void HandleEviction(GrBatchAtlas::AtlasID, void*); |
192 | 191 |
193 GrContext* fContext; | 192 GrContext* fContext; |
194 SkTDynamicHash<GrBatchTextStrike, GrFontDescKey> fCache; | 193 SkTDynamicHash<GrBatchTextStrike, GrFontDescKey> fCache; |
195 GrBatchAtlas* fAtlases[kMaskFormatCount]; | 194 GrBatchAtlas* fAtlases[kMaskFormatCount]; |
196 GrBatchTextStrike* fPreserveStrike; | 195 GrBatchTextStrike* fPreserveStrike; |
197 }; | 196 }; |
198 | 197 |
199 #endif | 198 #endif |
OLD | NEW |