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 // For debugging atlas which evict all of the time | 12 // For debugging atlas which evict all of the time |
13 //#define DEBUG_CONSTANT_EVICT | 13 //#define DEBUG_CONSTANT_EVICT |
14 #ifdef DEBUG_CONSTANT_EVICT | 14 #ifdef DEBUG_CONSTANT_EVICT |
15 #define GR_FONT_ATLAS_TEXTURE_WIDTH 256//1024 | 15 #define GR_FONT_ATLAS_TEXTURE_WIDTH 256//1024 |
16 #define GR_FONT_ATLAS_A8_TEXTURE_WIDTH 256//2048 | 16 #define GR_FONT_ATLAS_A8_TEXTURE_WIDTH 256//2048 |
17 #define GR_FONT_ATLAS_TEXTURE_HEIGHT 256//2048 | 17 #define GR_FONT_ATLAS_TEXTURE_HEIGHT 256//2048 |
18 | 18 |
19 #define GR_FONT_ATLAS_PLOT_WIDTH 256 | 19 #define GR_FONT_ATLAS_PLOT_WIDTH 256 |
20 #define GR_FONT_ATLAS_A8_PLOT_WIDTH 256//512 | 20 #define GR_FONT_ATLAS_A8_PLOT_WIDTH 256//512 |
21 #define GR_FONT_ATLAS_PLOT_HEIGHT 256 | 21 #define GR_FONT_ATLAS_PLOT_HEIGHT 256 |
22 | 22 |
23 #define GR_FONT_ATLAS_NUM_PLOTS_X (GR_FONT_ATLAS_TEXTURE_WIDTH / GR_FONT_ATL
AS_PLOT_WIDTH) | 23 #define GR_FONT_ATLAS_NUM_PLOTS_X (GR_FONT_ATLAS_TEXTURE_WIDTH / GR_FONT_ATL
AS_PLOT_WIDTH) |
24 #define GR_FONT_ATLAS_A8_NUM_PLOTS_X (GR_FONT_ATLAS_A8_TEXTURE_WIDTH / GR_FONT_
ATLAS_A8_PLOT_WIDTH) | 24 #define GR_FONT_ATLAS_A8_NUM_PLOTS_X (GR_FONT_ATLAS_A8_TEXTURE_WIDTH / GR_FONT_
ATLAS_A8_PLOT_WIDTH) |
25 #define GR_FONT_ATLAS_NUM_PLOTS_Y (GR_FONT_ATLAS_TEXTURE_HEIGHT / GR_FONT_AT
LAS_PLOT_HEIGHT) | 25 #define GR_FONT_ATLAS_NUM_PLOTS_Y (GR_FONT_ATLAS_TEXTURE_HEIGHT / GR_FONT_AT
LAS_PLOT_HEIGHT) |
| 26 |
| 27 // one over width and height |
| 28 #define GR_FONT_ATLAS_RECIP_WIDTH "0.00390625"//"0.0009765625" |
| 29 #define GR_FONT_ATLAS_A8_RECIP_WIDTH "0.00390625"//"0.00048828125" |
| 30 #define GR_FONT_ATLAS_RECIP_HEIGHT "0.00390625"//"0.00048828125" |
| 31 |
| 32 // 1/(3*width) |
| 33 // only used for distance fields, which are A8 |
| 34 #define GR_FONT_ATLAS_LCD_DELTA "0.001302083"//"0.000162760417" |
26 #else | 35 #else |
27 #define GR_FONT_ATLAS_TEXTURE_WIDTH 1024 | 36 #define GR_FONT_ATLAS_TEXTURE_WIDTH 1024 |
28 #define GR_FONT_ATLAS_A8_TEXTURE_WIDTH 2048 | 37 #define GR_FONT_ATLAS_A8_TEXTURE_WIDTH 2048 |
29 #define GR_FONT_ATLAS_TEXTURE_HEIGHT 2048 | 38 #define GR_FONT_ATLAS_TEXTURE_HEIGHT 2048 |
30 | 39 |
31 #define GR_FONT_ATLAS_PLOT_WIDTH 256 | 40 #define GR_FONT_ATLAS_PLOT_WIDTH 256 |
32 #define GR_FONT_ATLAS_A8_PLOT_WIDTH 512 | 41 #define GR_FONT_ATLAS_A8_PLOT_WIDTH 512 |
33 #define GR_FONT_ATLAS_PLOT_HEIGHT 256 | 42 #define GR_FONT_ATLAS_PLOT_HEIGHT 256 |
34 | 43 |
35 #define GR_FONT_ATLAS_NUM_PLOTS_X (GR_FONT_ATLAS_TEXTURE_WIDTH / GR_FONT_ATL
AS_PLOT_WIDTH) | 44 #define GR_FONT_ATLAS_NUM_PLOTS_X (GR_FONT_ATLAS_TEXTURE_WIDTH / GR_FONT_ATL
AS_PLOT_WIDTH) |
36 #define GR_FONT_ATLAS_A8_NUM_PLOTS_X (GR_FONT_ATLAS_A8_TEXTURE_WIDTH / GR_FONT_
ATLAS_A8_PLOT_WIDTH) | 45 #define GR_FONT_ATLAS_A8_NUM_PLOTS_X (GR_FONT_ATLAS_A8_TEXTURE_WIDTH / GR_FONT_
ATLAS_A8_PLOT_WIDTH) |
37 #define GR_FONT_ATLAS_NUM_PLOTS_Y (GR_FONT_ATLAS_TEXTURE_HEIGHT / GR_FONT_AT
LAS_PLOT_HEIGHT) | 46 #define GR_FONT_ATLAS_NUM_PLOTS_Y (GR_FONT_ATLAS_TEXTURE_HEIGHT / GR_FONT_AT
LAS_PLOT_HEIGHT) |
| 47 |
| 48 // one over width and height |
| 49 #define GR_FONT_ATLAS_RECIP_WIDTH "0.0009765625" |
| 50 #define GR_FONT_ATLAS_A8_RECIP_WIDTH "0.00048828125" |
| 51 #define GR_FONT_ATLAS_RECIP_HEIGHT "0.00048828125" |
| 52 |
| 53 // 1/(3*width) |
| 54 // only used for distance fields, which are A8 |
| 55 #define GR_FONT_ATLAS_LCD_DELTA "0.000162760417" |
38 #endif | 56 #endif |
39 #endif | 57 #endif |
OLD | NEW |