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

Unified Diff: src/gpu/GrFontCache.cpp

Issue 917373002: Use uint16s for texture coordinates when rendering text. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Use float uvs for distance field paths 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 3e83e6c950ba6927699b17e462f9f4fde33ef35d..2bc5567c19c5d74ea333b1a64b4b397f7268a8a3 100644
--- a/src/gpu/GrFontCache.cpp
+++ b/src/gpu/GrFontCache.cpp
@@ -6,6 +6,7 @@
*/
#include "GrFontCache.h"
+#include "GrFontAtlasSizes.h"
#include "GrGpu.h"
#include "GrRectanizer.h"
#include "GrSurfacePriv.h"
@@ -15,15 +16,6 @@
///////////////////////////////////////////////////////////////////////////////
-#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
static int g_PurgeCount = 0;
@@ -121,12 +113,12 @@ GrPlot* GrFontCache::addToAtlas(GrMaskFormat format, GrAtlas::ClientPlotUsage* u
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_ATLAS_TEXTURE_WIDTH,
- GR_ATLAS_TEXTURE_HEIGHT);
+ SkISize textureSize = SkISize::Make(GR_FONT_ATLAS_TEXTURE_WIDTH,
+ GR_FONT_ATLAS_TEXTURE_HEIGHT);
fAtlases[atlasIndex] = SkNEW_ARGS(GrAtlas, (fGpu, config, kNone_GrSurfaceFlags,
textureSize,
- GR_NUM_PLOTS_X,
- GR_NUM_PLOTS_Y,
+ GR_FONT_ATLAS_NUM_PLOTS_X,
+ GR_FONT_ATLAS_NUM_PLOTS_Y,
true));
}
return fAtlases[atlasIndex]->addToAtlas(usage, width, height, image, loc);
@@ -289,10 +281,10 @@ bool GrTextStrike::glyphTooLargeForAtlas(GrGlyph* glyph) {
int width = glyph->fBounds.width();
int height = glyph->fBounds.height();
int pad = fUseDistanceField ? 2 * SK_DistanceFieldPad : 0;
- if (width + pad > GR_PLOT_WIDTH) {
+ if (width + pad > GR_FONT_ATLAS_PLOT_WIDTH) {
return true;
}
- if (height + pad > GR_PLOT_HEIGHT) {
+ if (height + pad > GR_FONT_ATLAS_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