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 #define GR_FONT_ATLAS_TEXTURE_WIDTH 1024 | 12 #include "SkDistanceFieldGen.h" |
13 #define GR_FONT_ATLAS_TEXTURE_HEIGHT 2048 | |
14 | 13 |
15 #define GR_FONT_ATLAS_PLOT_WIDTH 256 | 14 #define GR_SDF_MAX_SIZE 156 |
16 #define GR_FONT_ATLAS_PLOT_HEIGHT 256 | |
17 | 15 |
18 #define GR_FONT_ATLAS_NUM_PLOTS_X (GR_FONT_ATLAS_TEXTURE_WIDTH / GR_FONT_ATLAS
_PLOT_WIDTH) | 16 // allows us to fit four of the largest distance field glyphs |
19 #define GR_FONT_ATLAS_NUM_PLOTS_Y (GR_FONT_ATLAS_TEXTURE_HEIGHT / GR_FONT_ATLA
S_PLOT_HEIGHT) | 17 #define GR_FONT_ATLAS_PLOT_WIDTH (2*(GR_SDF_MAX_SIZE+2*SK_DistanceFieldPad)) |
| 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); |
20 | 27 |
21 // one over width and height | 28 // one over width and height |
22 #define GR_FONT_ATLAS_RECIP_WIDTH "0.0009765625" | 29 #define GR_FONT_ATLAS_RECIP_WIDTH "0.00060975609" |
23 #define GR_FONT_ATLAS_RECIP_HEIGHT "0.00048828125" | 30 #define GR_FONT_ATLAS_RECIP_HEIGHT "0.00050813008" |
24 | 31 |
25 // 1/(3*width) | 32 // 1/(3*width) |
26 #define GR_FONT_ATLAS_LCD_DELTA "0.00032552083" | 33 #define GR_FONT_ATLAS_LCD_DELTA "0.00020325203" |
27 | 34 |
28 #endif | 35 #endif |
OLD | NEW |