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