| 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 return this->getAtlas(format)->addToAtlas(id, target, width, height, ima
ge, loc); | 164 return this->getAtlas(format)->addToAtlas(id, target, width, height, ima
ge, loc); |
| 165 } | 165 } |
| 166 | 166 |
| 167 // Some clients may wish to verify the integrity of the texture backing stor
e of the | 167 // Some clients may wish to verify the integrity of the texture backing stor
e of the |
| 168 // GrBatchAtlas. The atlasGeneration returned below is a monitonically incr
easing number which | 168 // GrBatchAtlas. The atlasGeneration returned below is a monitonically incr
easing number which |
| 169 // changes everytime something is removed from the texture backing store. | 169 // changes everytime something is removed from the texture backing store. |
| 170 uint64_t atlasGeneration(GrMaskFormat format) const { | 170 uint64_t atlasGeneration(GrMaskFormat format) const { |
| 171 return this->getAtlas(format)->atlasGeneration(); | 171 return this->getAtlas(format)->atlasGeneration(); |
| 172 } | 172 } |
| 173 | 173 |
| 174 int log2Width(GrMaskFormat format) { return fAtlasConfigs[format].log2Width(
); } |
| 175 int log2Height(GrMaskFormat format) { return fAtlasConfigs[format].log2Heigh
t(); } |
| 176 |
| 174 /////////////////////////////////////////////////////////////////////////// | 177 /////////////////////////////////////////////////////////////////////////// |
| 175 // Functions intended debug only | 178 // Functions intended debug only |
| 176 void dump() const; | 179 void dump() const; |
| 177 | 180 |
| 178 void setAtlasSizes_ForTesting(const GrBatchAtlasConfig configs[3]); | 181 void setAtlasSizes_ForTesting(const GrBatchAtlasConfig configs[3]); |
| 179 | 182 |
| 180 private: | 183 private: |
| 181 static GrPixelConfig MaskFormatToPixelConfig(GrMaskFormat format) { | 184 static GrPixelConfig MaskFormatToPixelConfig(GrMaskFormat format) { |
| 182 static const GrPixelConfig kPixelConfigs[] = { | 185 static const GrPixelConfig kPixelConfigs[] = { |
| 183 kAlpha_8_GrPixelConfig, | 186 kAlpha_8_GrPixelConfig, |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 static void HandleEviction(GrBatchAtlas::AtlasID, void*); | 222 static void HandleEviction(GrBatchAtlas::AtlasID, void*); |
| 220 | 223 |
| 221 GrContext* fContext; | 224 GrContext* fContext; |
| 222 SkTDynamicHash<GrBatchTextStrike, GrFontDescKey> fCache; | 225 SkTDynamicHash<GrBatchTextStrike, GrFontDescKey> fCache; |
| 223 GrBatchAtlas* fAtlases[kMaskFormatCount]; | 226 GrBatchAtlas* fAtlases[kMaskFormatCount]; |
| 224 GrBatchTextStrike* fPreserveStrike; | 227 GrBatchTextStrike* fPreserveStrike; |
| 225 GrBatchAtlasConfig fAtlasConfigs[kMaskFormatCount]; | 228 GrBatchAtlasConfig fAtlasConfigs[kMaskFormatCount]; |
| 226 }; | 229 }; |
| 227 | 230 |
| 228 #endif | 231 #endif |
| OLD | NEW |