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_A8_TEXTURE_WIDTH 2048 |
| 14 #define GR_FONT_ATLAS_TEXTURE_HEIGHT 2048 |
13 | 15 |
14 #define GR_SDF_MAX_SIZE 156 | 16 #define GR_FONT_ATLAS_PLOT_WIDTH 256 |
| 17 #define GR_FONT_ATLAS_A8_PLOT_WIDTH 512 |
| 18 #define GR_FONT_ATLAS_PLOT_HEIGHT 256 |
15 | 19 |
16 // allows us to fit four of the largest distance field glyphs | 20 #define GR_FONT_ATLAS_NUM_PLOTS_X (GR_FONT_ATLAS_TEXTURE_WIDTH / GR_FONT_ATL
AS_PLOT_WIDTH) |
17 #define GR_FONT_ATLAS_PLOT_WIDTH (2*(GR_SDF_MAX_SIZE+2*SK_DistanceFieldPad)) | 21 #define GR_FONT_ATLAS_A8_NUM_PLOTS_X (GR_FONT_ATLAS_A8_TEXTURE_WIDTH / GR_FONT_
ATLAS_A8_PLOT_WIDTH) |
18 #define GR_FONT_ATLAS_PLOT_HEIGHT (2*(GR_SDF_MAX_SIZE+2*SK_DistanceFieldPad)) | 22 #define GR_FONT_ATLAS_NUM_PLOTS_Y (GR_FONT_ATLAS_TEXTURE_HEIGHT / GR_FONT_AT
LAS_PLOT_HEIGHT) |
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 | 23 |
28 // one over width and height | 24 // one over width and height |
29 #define GR_FONT_ATLAS_RECIP_WIDTH "0.00060975609" | 25 #define GR_FONT_ATLAS_RECIP_WIDTH "0.0009765625" |
30 #define GR_FONT_ATLAS_RECIP_HEIGHT "0.00050813008" | 26 #define GR_FONT_ATLAS_A8_RECIP_WIDTH "0.00048828125" |
| 27 #define GR_FONT_ATLAS_RECIP_HEIGHT "0.00048828125" |
31 | 28 |
32 // 1/(3*width) | 29 // 1/(3*width) |
33 #define GR_FONT_ATLAS_LCD_DELTA "0.00020325203" | 30 // only used for distance fields, which are A8 |
| 31 #define GR_FONT_ATLAS_LCD_DELTA "0.000162760417" |
34 | 32 |
35 #endif | 33 #endif |
OLD | NEW |