Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(273)

Unified Diff: src/gpu/GrFontAtlasSizes.h

Issue 994303003: Adjust atlas sizes to fix Mali400 precision issues (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrDistanceFieldTextContext.cpp ('k') | src/gpu/GrFontCache.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrFontAtlasSizes.h
diff --git a/src/gpu/GrFontAtlasSizes.h b/src/gpu/GrFontAtlasSizes.h
index 5a1821cdcebd3c821c7adced02e3ef40266c599e..d5c5e287e184e30bda772f74a4daf41dd5ee7639 100644
--- a/src/gpu/GrFontAtlasSizes.h
+++ b/src/gpu/GrFontAtlasSizes.h
@@ -9,27 +9,25 @@
#ifndef GrFontAtlasSizes_DEFINED
#define GrFontAtlasSizes_DEFINED
-#include "SkDistanceFieldGen.h"
+#define GR_FONT_ATLAS_TEXTURE_WIDTH 1024
+#define GR_FONT_ATLAS_A8_TEXTURE_WIDTH 2048
+#define GR_FONT_ATLAS_TEXTURE_HEIGHT 2048
-#define GR_SDF_MAX_SIZE 156
+#define GR_FONT_ATLAS_PLOT_WIDTH 256
+#define GR_FONT_ATLAS_A8_PLOT_WIDTH 512
+#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 5
-#define GR_FONT_ATLAS_NUM_PLOTS_Y 6
-
-#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 == 1640, 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 == 1968, 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_A8_NUM_PLOTS_X (GR_FONT_ATLAS_A8_TEXTURE_WIDTH / GR_FONT_ATLAS_A8_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.00060975609"
-#define GR_FONT_ATLAS_RECIP_HEIGHT "0.00050813008"
+#define GR_FONT_ATLAS_RECIP_WIDTH "0.0009765625"
+#define GR_FONT_ATLAS_A8_RECIP_WIDTH "0.00048828125"
+#define GR_FONT_ATLAS_RECIP_HEIGHT "0.00048828125"
// 1/(3*width)
-#define GR_FONT_ATLAS_LCD_DELTA "0.00020325203"
+// only used for distance fields, which are A8
+#define GR_FONT_ATLAS_LCD_DELTA "0.000162760417"
#endif
« no previous file with comments | « src/gpu/GrDistanceFieldTextContext.cpp ('k') | src/gpu/GrFontCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698