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].fLog2Width
; } | |
175 int log2Height(GrMaskFormat format) { return fAtlasConfigs[format].fLog2Heig
ht; } | |
176 | |
177 /////////////////////////////////////////////////////////////////////////// | 174 /////////////////////////////////////////////////////////////////////////// |
178 // Functions intended debug only | 175 // Functions intended debug only |
179 void dump() const; | 176 void dump() const; |
180 | 177 |
181 void setAtlasSizes_ForTesting(const GrBatchAtlasConfig configs[3]); | 178 void setAtlasSizes_ForTesting(const GrBatchAtlasConfig configs[3]); |
182 | 179 |
183 private: | 180 private: |
184 static GrPixelConfig MaskFormatToPixelConfig(GrMaskFormat format) { | 181 static GrPixelConfig MaskFormatToPixelConfig(GrMaskFormat format) { |
185 static const GrPixelConfig kPixelConfigs[] = { | 182 static const GrPixelConfig kPixelConfigs[] = { |
186 kAlpha_8_GrPixelConfig, | 183 kAlpha_8_GrPixelConfig, |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 static void HandleEviction(GrBatchAtlas::AtlasID, void*); | 219 static void HandleEviction(GrBatchAtlas::AtlasID, void*); |
223 | 220 |
224 GrContext* fContext; | 221 GrContext* fContext; |
225 SkTDynamicHash<GrBatchTextStrike, GrFontDescKey> fCache; | 222 SkTDynamicHash<GrBatchTextStrike, GrFontDescKey> fCache; |
226 GrBatchAtlas* fAtlases[kMaskFormatCount]; | 223 GrBatchAtlas* fAtlases[kMaskFormatCount]; |
227 GrBatchTextStrike* fPreserveStrike; | 224 GrBatchTextStrike* fPreserveStrike; |
228 GrBatchAtlasConfig fAtlasConfigs[kMaskFormatCount]; | 225 GrBatchAtlasConfig fAtlasConfigs[kMaskFormatCount]; |
229 }; | 226 }; |
230 | 227 |
231 #endif | 228 #endif |
OLD | NEW |