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 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 GrBatchTextStrike* strike = fCache.find(*(scaler->getKey())); | 90 GrBatchTextStrike* strike = fCache.find(*(scaler->getKey())); |
91 if (NULL == strike) { | 91 if (NULL == strike) { |
92 strike = this->generateStrike(scaler); | 92 strike = this->generateStrike(scaler); |
93 } | 93 } |
94 return strike; | 94 return strike; |
95 } | 95 } |
96 | 96 |
97 bool hasGlyph(GrGlyph* glyph); | 97 bool hasGlyph(GrGlyph* glyph); |
98 | 98 |
99 // To ensure the GrBatchAtlas does not evict the Glyph Mask from its texture
backing store, | 99 // To ensure the GrBatchAtlas does not evict the Glyph Mask from its texture
backing store, |
100 // the client must pass in the currentToken from the GrBatchTarget along wit
h the GrGlyph | 100 // the client must pass in the currentToken from the GrBatchTarget along wit
h the GrGlyph. |
101 void setGlyphRefToken(GrGlyph*, GrBatchAtlas::BatchToken); | 101 // A BulkTokenReffer is used to manage bulk last ref token updating in the A
tlas. |
| 102 void setGlyphRefToken(GrBatchAtlas::BulkTokenReffer*, GrGlyph*, GrBatchAtlas
::BatchToken); |
| 103 void setRefTokenBulk(const GrBatchAtlas::BulkTokenReffer& reffer, GrMaskForm
at format); |
102 | 104 |
103 // add to texture atlas that matches this format | 105 // add to texture atlas that matches this format |
104 bool addToAtlas(GrBatchTextStrike*, GrBatchAtlas::AtlasID*, GrBatchTarget*, | 106 bool addToAtlas(GrBatchTextStrike*, GrBatchAtlas::AtlasID*, GrBatchTarget*, |
105 GrMaskFormat, int width, int height, const void* image, | 107 GrMaskFormat, int width, int height, const void* image, |
106 SkIPoint16* loc); | 108 SkIPoint16* loc); |
107 | 109 |
108 // Some clients may wish to verify the integrity of the texture backing stor
e of the | 110 // Some clients may wish to verify the integrity of the texture backing stor
e of the |
109 // GrBatchAtlas. The atlasGeneration returned below is a monitonically incr
easing number which | 111 // GrBatchAtlas. The atlasGeneration returned below is a monitonically incr
easing number which |
110 // changes everytime something is removed from the texture backing store. | 112 // changes everytime something is removed from the texture backing store. |
111 uint64_t atlasGeneration(GrMaskFormat) const; | 113 uint64_t atlasGeneration(GrMaskFormat) const; |
(...skipping 16 matching lines...) Expand all Loading... |
128 | 130 |
129 static void HandleEviction(GrBatchAtlas::AtlasID, void*); | 131 static void HandleEviction(GrBatchAtlas::AtlasID, void*); |
130 | 132 |
131 SkTDynamicHash<GrBatchTextStrike, GrFontDescKey> fCache; | 133 SkTDynamicHash<GrBatchTextStrike, GrFontDescKey> fCache; |
132 | 134 |
133 GrBatchAtlas* fAtlases[kMaskFormatCount]; | 135 GrBatchAtlas* fAtlases[kMaskFormatCount]; |
134 GrBatchTextStrike* fPreserveStrike; | 136 GrBatchTextStrike* fPreserveStrike; |
135 }; | 137 }; |
136 | 138 |
137 #endif | 139 #endif |
OLD | NEW |