Index: src/gpu/GrFontCache.cpp |
diff --git a/src/gpu/GrFontCache.cpp b/src/gpu/GrFontCache.cpp |
index 2bc5567c19c5d74ea333b1a64b4b397f7268a8a3..3e83e6c950ba6927699b17e462f9f4fde33ef35d 100644 |
--- a/src/gpu/GrFontCache.cpp |
+++ b/src/gpu/GrFontCache.cpp |
@@ -6,7 +6,6 @@ |
*/ |
#include "GrFontCache.h" |
-#include "GrFontAtlasSizes.h" |
#include "GrGpu.h" |
#include "GrRectanizer.h" |
#include "GrSurfacePriv.h" |
@@ -15,6 +14,15 @@ |
#include "SkDistanceFieldGen.h" |
/////////////////////////////////////////////////////////////////////////////// |
+ |
+#define GR_ATLAS_TEXTURE_WIDTH 1024 |
+#define GR_ATLAS_TEXTURE_HEIGHT 2048 |
+ |
+#define GR_PLOT_WIDTH 256 |
+#define GR_PLOT_HEIGHT 256 |
+ |
+#define GR_NUM_PLOTS_X (GR_ATLAS_TEXTURE_WIDTH / GR_PLOT_WIDTH) |
+#define GR_NUM_PLOTS_Y (GR_ATLAS_TEXTURE_HEIGHT / GR_PLOT_HEIGHT) |
#define FONT_CACHE_STATS 0 |
#if FONT_CACHE_STATS |
@@ -113,12 +121,12 @@ |
GrPixelConfig config = mask_format_to_pixel_config(format); |
int atlasIndex = mask_format_to_atlas_index(format); |
if (NULL == fAtlases[atlasIndex]) { |
- SkISize textureSize = SkISize::Make(GR_FONT_ATLAS_TEXTURE_WIDTH, |
- GR_FONT_ATLAS_TEXTURE_HEIGHT); |
+ SkISize textureSize = SkISize::Make(GR_ATLAS_TEXTURE_WIDTH, |
+ GR_ATLAS_TEXTURE_HEIGHT); |
fAtlases[atlasIndex] = SkNEW_ARGS(GrAtlas, (fGpu, config, kNone_GrSurfaceFlags, |
textureSize, |
- GR_FONT_ATLAS_NUM_PLOTS_X, |
- GR_FONT_ATLAS_NUM_PLOTS_Y, |
+ GR_NUM_PLOTS_X, |
+ GR_NUM_PLOTS_Y, |
true)); |
} |
return fAtlases[atlasIndex]->addToAtlas(usage, width, height, image, loc); |
@@ -281,10 +289,10 @@ |
int width = glyph->fBounds.width(); |
int height = glyph->fBounds.height(); |
int pad = fUseDistanceField ? 2 * SK_DistanceFieldPad : 0; |
- if (width + pad > GR_FONT_ATLAS_PLOT_WIDTH) { |
+ if (width + pad > GR_PLOT_WIDTH) { |
return true; |
} |
- if (height + pad > GR_FONT_ATLAS_PLOT_HEIGHT) { |
+ if (height + pad > GR_PLOT_HEIGHT) { |
return true; |
} |