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

Unified Diff: src/gpu/GrFontCache.cpp

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/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..f5c1c22a3da9cd87e2a081ddc1fb4b88a376947b 100644
--- a/src/gpu/GrFontCache.cpp
+++ b/src/gpu/GrFontCache.cpp
@@ -113,13 +113,23 @@ 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_FONT_ATLAS_TEXTURE_WIDTH,
- GR_FONT_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,
- true));
+ if (kA8_GrMaskFormat == format) {
+ SkISize textureSize = SkISize::Make(GR_FONT_ATLAS_A8_TEXTURE_WIDTH,
+ GR_FONT_ATLAS_TEXTURE_HEIGHT);
+ fAtlases[atlasIndex] = SkNEW_ARGS(GrAtlas, (fGpu, config, kNone_GrSurfaceFlags,
+ textureSize,
+ GR_FONT_ATLAS_A8_NUM_PLOTS_X,
+ GR_FONT_ATLAS_NUM_PLOTS_Y,
+ true));
+ } else {
+ 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_FONT_ATLAS_NUM_PLOTS_X,
+ GR_FONT_ATLAS_NUM_PLOTS_Y,
+ true));
+ }
}
return fAtlases[atlasIndex]->addToAtlas(usage, width, height, image, loc);
}
@@ -281,7 +291,9 @@ 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_FONT_ATLAS_PLOT_WIDTH) {
+ int plotWidth = (kA8_GrMaskFormat == glyph->fMaskFormat) ? GR_FONT_ATLAS_A8_PLOT_WIDTH
+ : GR_FONT_ATLAS_PLOT_WIDTH;
+ if (width + pad > plotWidth) {
return true;
}
if (height + pad > GR_FONT_ATLAS_PLOT_HEIGHT) {
« 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