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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 int log2Width(GrMaskFormat format) { return fAtlasConfigs[format].fLog2Width
; } | 179 int log2Width(GrMaskFormat format) { return fAtlasConfigs[format].fLog2Width
; } |
180 int log2Height(GrMaskFormat format) { return fAtlasConfigs[format].fLog2Heig
ht; } | 180 int log2Height(GrMaskFormat format) { return fAtlasConfigs[format].fLog2Heig
ht; } |
181 | 181 |
182 /////////////////////////////////////////////////////////////////////////// | 182 /////////////////////////////////////////////////////////////////////////// |
183 // Functions intended debug only | 183 // Functions intended debug only |
184 void dump() const; | 184 void dump() const; |
185 | 185 |
186 void setAtlasSizes_ForTesting(const GrBatchAtlasConfig configs[3]); | 186 void setAtlasSizes_ForTesting(const GrBatchAtlasConfig configs[3]); |
187 | 187 |
188 private: | 188 private: |
189 static GrPixelConfig MaskFormatToPixelConfig(GrMaskFormat format, const GrCa
ps& caps) { | 189 static GrPixelConfig MaskFormatToPixelConfig(GrMaskFormat format) { |
190 static const GrPixelConfig kPixelConfigs[] = { | 190 static const GrPixelConfig kPixelConfigs[] = { |
191 kAlpha_8_GrPixelConfig, | 191 kAlpha_8_GrPixelConfig, |
192 kRGB_565_GrPixelConfig, | 192 kRGB_565_GrPixelConfig, |
193 caps.srgbSupport() ? kSkiaGamma8888_GrPixelConfig : kSkia8888_GrPixe
lConfig | 193 kSkia8888_GrPixelConfig |
194 }; | 194 }; |
195 static_assert(SK_ARRAY_COUNT(kPixelConfigs) == kMaskFormatCount, "array_
size_mismatch"); | 195 static_assert(SK_ARRAY_COUNT(kPixelConfigs) == kMaskFormatCount, "array_
size_mismatch"); |
196 | 196 |
197 return kPixelConfigs[format]; | 197 return kPixelConfigs[format]; |
198 } | 198 } |
199 | 199 |
200 // There is a 1:1 mapping between GrMaskFormats and atlas indices | 200 // There is a 1:1 mapping between GrMaskFormats and atlas indices |
201 static int MaskFormatToAtlasIndex(GrMaskFormat format) { | 201 static int MaskFormatToAtlasIndex(GrMaskFormat format) { |
202 static const int sAtlasIndices[] = { | 202 static const int sAtlasIndices[] = { |
203 kA8_GrMaskFormat, | 203 kA8_GrMaskFormat, |
(...skipping 24 matching lines...) Expand all Loading... |
228 | 228 |
229 using StrikeHash = SkTDynamicHash<GrBatchTextStrike, SkDescriptor>; | 229 using StrikeHash = SkTDynamicHash<GrBatchTextStrike, SkDescriptor>; |
230 GrContext* fContext; | 230 GrContext* fContext; |
231 StrikeHash fCache; | 231 StrikeHash fCache; |
232 GrBatchAtlas* fAtlases[kMaskFormatCount]; | 232 GrBatchAtlas* fAtlases[kMaskFormatCount]; |
233 GrBatchTextStrike* fPreserveStrike; | 233 GrBatchTextStrike* fPreserveStrike; |
234 GrBatchAtlasConfig fAtlasConfigs[kMaskFormatCount]; | 234 GrBatchAtlasConfig fAtlasConfigs[kMaskFormatCount]; |
235 }; | 235 }; |
236 | 236 |
237 #endif | 237 #endif |
OLD | NEW |