OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2015 Google Inc. | 3 * Copyright 2015 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #ifndef GrFontAtlasSizes_DEFINED | 9 #ifndef GrFontAtlasSizes_DEFINED |
10 #define GrFontAtlasSizes_DEFINED | 10 #define GrFontAtlasSizes_DEFINED |
11 | 11 |
12 #include "SkDistanceFieldGen.h" | 12 #define GR_FONT_ATLAS_TEXTURE_WIDTH 1024 |
| 13 #define GR_FONT_ATLAS_TEXTURE_HEIGHT 2048 |
13 | 14 |
14 #define GR_SDF_MAX_SIZE 156 | 15 #define GR_FONT_ATLAS_PLOT_WIDTH 256 |
| 16 #define GR_FONT_ATLAS_PLOT_HEIGHT 256 |
15 | 17 |
16 // allows us to fit four of the largest distance field glyphs | 18 #define GR_FONT_ATLAS_NUM_PLOTS_X (GR_FONT_ATLAS_TEXTURE_WIDTH / GR_FONT_ATLAS
_PLOT_WIDTH) |
17 #define GR_FONT_ATLAS_PLOT_WIDTH (2*(GR_SDF_MAX_SIZE+2*SK_DistanceFieldPad)) | 19 #define GR_FONT_ATLAS_NUM_PLOTS_Y (GR_FONT_ATLAS_TEXTURE_HEIGHT / GR_FONT_ATLA
S_PLOT_HEIGHT) |
18 #define GR_FONT_ATLAS_PLOT_HEIGHT (2*(GR_SDF_MAX_SIZE+2*SK_DistanceFieldPad)) | |
19 | |
20 #define GR_FONT_ATLAS_NUM_PLOTS_X 5 | |
21 #define GR_FONT_ATLAS_NUM_PLOTS_Y 6 | |
22 | |
23 #define GR_FONT_ATLAS_TEXTURE_WIDTH (GR_FONT_ATLAS_PLOT_WIDTH*GR_FONT_ATLAS_NUM
_PLOTS_X) | |
24 SK_COMPILE_ASSERT(GR_FONT_ATLAS_TEXTURE_WIDTH == 1640, font_atlas_unexpected_siz
e); | |
25 #define GR_FONT_ATLAS_TEXTURE_HEIGHT (GR_FONT_ATLAS_PLOT_HEIGHT*GR_FONT_ATLAS_NU
M_PLOTS_Y) | |
26 SK_COMPILE_ASSERT(GR_FONT_ATLAS_TEXTURE_HEIGHT == 1968, font_atlas_unexpected_si
ze); | |
27 | 20 |
28 // one over width and height | 21 // one over width and height |
29 #define GR_FONT_ATLAS_RECIP_WIDTH "0.00060975609" | 22 #define GR_FONT_ATLAS_RECIP_WIDTH "0.0009765625" |
30 #define GR_FONT_ATLAS_RECIP_HEIGHT "0.00050813008" | 23 #define GR_FONT_ATLAS_RECIP_HEIGHT "0.00048828125" |
31 | 24 |
32 // 1/(3*width) | 25 // 1/(3*width) |
33 #define GR_FONT_ATLAS_LCD_DELTA "0.00020325203" | 26 #define GR_FONT_ATLAS_LCD_DELTA "0.00032552083" |
34 | 27 |
35 #endif | 28 #endif |
OLD | NEW |