| 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 4 | |
| 21 #define GR_FONT_ATLAS_NUM_PLOTS_Y 8 | |
| 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 == 1312, 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 == 2624, 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.00076219512" | 22 #define GR_FONT_ATLAS_RECIP_WIDTH "0.0009765625" |
| 30 #define GR_FONT_ATLAS_RECIP_HEIGHT "0.00038109756" | 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.00025406504" | 26 #define GR_FONT_ATLAS_LCD_DELTA "0.00032552083" |
| 34 | 27 |
| 35 #endif | 28 #endif |
| OLD | NEW |