Revert of Adjust distance field glyph and font atlas sizes to maximize storage. (patchset #5 id:80001 of https://codereview.chromium.org/986343002/)

Reason for revert:
There's some weirdness with Tegra2 and Tegra3 GMs (Xoom and Nexus7) that may be related to this.

Original issue's description:
> Adjust distance field glyph and font atlas sizes to maximize storage.
>
> Because of high DPI devices, we need more room in the glyph
> atlas for the larger glyphs. These settings will allow 4 of
> the distance field glyphs to fit in one Plot (increasing
> the storage from 32 large glyphs to 128), and still permit
> us to handle glyphs up to a 312 point size.
>
> BUG=chromium:458791
>
> Committed: https://skia.googlesource.com/skia/+/d2737ad7dd8f4ea94a74034027014fd3d78923cb

TBR=joshualitt@google.com,bsalomon@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:458791

Review URL: https://codereview.chromium.org/986333005
This commit is contained in:
jvanverth 2015-03-09 12:17:07 -07:00 committed by Commit bot
parent 5baedd6378
commit a548593a65
2 changed files with 12 additions and 21 deletions

View File

@ -10,7 +10,6 @@
#include "GrBitmapTextContext.h"
#include "GrDrawTarget.h"
#include "GrDrawTargetCaps.h"
#include "GrFontAtlasSizes.h"
#include "GrFontCache.h"
#include "GrFontScaler.h"
#include "GrGpu.h"
@ -34,10 +33,9 @@ SK_CONF_DECLARE(bool, c_DumpFontCache, "gpu.dumpFontCache", false,
static const int kSmallDFFontSize = 32;
static const int kSmallDFFontLimit = 32;
static const int kMediumDFFontSize = 70;
static const int kMediumDFFontLimit = 70;
static const int kLargeDFFontSize = 156;
SK_COMPILE_ASSERT(GR_SDF_MAX_SIZE >= kLargeDFFontSize, sdf_too_big);
static const int kMediumDFFontSize = 78;
static const int kMediumDFFontLimit = 78;
static const int kLargeDFFontSize = 192;
static const int kVerticesPerGlyph = 4;
static const int kIndicesPerGlyph = 6;

View File

@ -9,27 +9,20 @@
#ifndef GrFontAtlasSizes_DEFINED
#define GrFontAtlasSizes_DEFINED
#include "SkDistanceFieldGen.h"
#define GR_FONT_ATLAS_TEXTURE_WIDTH 1024
#define GR_FONT_ATLAS_TEXTURE_HEIGHT 2048
#define GR_SDF_MAX_SIZE 156
#define GR_FONT_ATLAS_PLOT_WIDTH 256
#define GR_FONT_ATLAS_PLOT_HEIGHT 256
// allows us to fit four of the largest distance field glyphs
#define GR_FONT_ATLAS_PLOT_WIDTH (2*(GR_SDF_MAX_SIZE+2*SK_DistanceFieldPad))
#define GR_FONT_ATLAS_PLOT_HEIGHT (2*(GR_SDF_MAX_SIZE+2*SK_DistanceFieldPad))
#define GR_FONT_ATLAS_NUM_PLOTS_X 4
#define GR_FONT_ATLAS_NUM_PLOTS_Y 8
#define GR_FONT_ATLAS_TEXTURE_WIDTH (GR_FONT_ATLAS_PLOT_WIDTH*GR_FONT_ATLAS_NUM_PLOTS_X)
SK_COMPILE_ASSERT(GR_FONT_ATLAS_TEXTURE_WIDTH == 1312, font_atlas_unexpected_size);
#define GR_FONT_ATLAS_TEXTURE_HEIGHT (GR_FONT_ATLAS_PLOT_HEIGHT*GR_FONT_ATLAS_NUM_PLOTS_Y)
SK_COMPILE_ASSERT(GR_FONT_ATLAS_TEXTURE_HEIGHT == 2624, font_atlas_unexpected_size);
#define GR_FONT_ATLAS_NUM_PLOTS_X (GR_FONT_ATLAS_TEXTURE_WIDTH / GR_FONT_ATLAS_PLOT_WIDTH)
#define GR_FONT_ATLAS_NUM_PLOTS_Y (GR_FONT_ATLAS_TEXTURE_HEIGHT / GR_FONT_ATLAS_PLOT_HEIGHT)
// one over width and height
#define GR_FONT_ATLAS_RECIP_WIDTH "0.00076219512"
#define GR_FONT_ATLAS_RECIP_HEIGHT "0.00038109756"
#define GR_FONT_ATLAS_RECIP_WIDTH "0.0009765625"
#define GR_FONT_ATLAS_RECIP_HEIGHT "0.00048828125"
// 1/(3*width)
#define GR_FONT_ATLAS_LCD_DELTA "0.00025406504"
#define GR_FONT_ATLAS_LCD_DELTA "0.00032552083"
#endif