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

Unified Diff: src/gpu/GrFontCache.cpp

Issue 920333003: Revert of Use uint16s for texture coordinates when rendering text. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 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/GrFontAtlasSizes.h ('k') | src/gpu/effects/GrBitmapTextGeoProc.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « src/gpu/GrFontAtlasSizes.h ('k') | src/gpu/effects/GrBitmapTextGeoProc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698