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 // A BulkUseTokenUpdater is used to manage bulk last use token updating in t
he Atlas. | 101 void setGlyphRefToken(GrGlyph*, GrBatchAtlas::BatchToken); |
102 // For convenience, this function will also set the use token for the curren
t glyph if required | |
103 // NOTE: the bulk uploader is only valid if the subrun has a valid atlasGene
ration | |
104 void addGlyphToBulkAndSetUseToken(GrBatchAtlas::BulkUseTokenUpdater*, GrGlyp
h*, | |
105 GrBatchAtlas::BatchToken); | |
106 | |
107 void setUseTokenBulk(const GrBatchAtlas::BulkUseTokenUpdater&, GrBatchAtlas:
:BatchToken, | |
108 GrMaskFormat); | |
109 | 102 |
110 // add to texture atlas that matches this format | 103 // add to texture atlas that matches this format |
111 bool addToAtlas(GrBatchTextStrike*, GrBatchAtlas::AtlasID*, GrBatchTarget*, | 104 bool addToAtlas(GrBatchTextStrike*, GrBatchAtlas::AtlasID*, GrBatchTarget*, |
112 GrMaskFormat, int width, int height, const void* image, | 105 GrMaskFormat, int width, int height, const void* image, |
113 SkIPoint16* loc); | 106 SkIPoint16* loc); |
114 | 107 |
115 // Some clients may wish to verify the integrity of the texture backing stor
e of the | 108 // Some clients may wish to verify the integrity of the texture backing stor
e of the |
116 // GrBatchAtlas. The atlasGeneration returned below is a monitonically incr
easing number which | 109 // GrBatchAtlas. The atlasGeneration returned below is a monitonically incr
easing number which |
117 // changes everytime something is removed from the texture backing store. | 110 // changes everytime something is removed from the texture backing store. |
118 uint64_t atlasGeneration(GrMaskFormat) const; | 111 uint64_t atlasGeneration(GrMaskFormat) const; |
(...skipping 16 matching lines...) Expand all Loading... |
135 | 128 |
136 static void HandleEviction(GrBatchAtlas::AtlasID, void*); | 129 static void HandleEviction(GrBatchAtlas::AtlasID, void*); |
137 | 130 |
138 SkTDynamicHash<GrBatchTextStrike, GrFontDescKey> fCache; | 131 SkTDynamicHash<GrBatchTextStrike, GrFontDescKey> fCache; |
139 | 132 |
140 GrBatchAtlas* fAtlases[kMaskFormatCount]; | 133 GrBatchAtlas* fAtlases[kMaskFormatCount]; |
141 GrBatchTextStrike* fPreserveStrike; | 134 GrBatchTextStrike* fPreserveStrike; |
142 }; | 135 }; |
143 | 136 |
144 #endif | 137 #endif |
OLD | NEW |