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

Unified Diff: src/gpu/GrDistanceFieldTextContext.cpp

Issue 986343002: Adjust distance field glyph and font atlas sizes to maximize storage. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Use texture clamping with NPOT text atlas 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/GrBitmapTextContext.cpp ('k') | src/gpu/GrFontAtlasSizes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDistanceFieldTextContext.cpp
diff --git a/src/gpu/GrDistanceFieldTextContext.cpp b/src/gpu/GrDistanceFieldTextContext.cpp
index 47d408f7f8969270ab01beb53c7386931a82dd44..a9fe4c9bf6fac7f1ff2213c123533dd70a70b5af 100755
--- a/src/gpu/GrDistanceFieldTextContext.cpp
+++ b/src/gpu/GrDistanceFieldTextContext.cpp
@@ -10,6 +10,7 @@
#include "GrBitmapTextContext.h"
#include "GrDrawTarget.h"
#include "GrDrawTargetCaps.h"
+#include "GrFontAtlasSizes.h"
#include "GrFontCache.h"
#include "GrFontScaler.h"
#include "GrGpu.h"
@@ -33,9 +34,10 @@ SK_CONF_DECLARE(bool, c_DumpFontCache, "gpu.dumpFontCache", false,
static const int kSmallDFFontSize = 32;
static const int kSmallDFFontLimit = 32;
-static const int kMediumDFFontSize = 78;
-static const int kMediumDFFontLimit = 78;
-static const int kLargeDFFontSize = 192;
+static const int kMediumDFFontSize = 70;
+static const int kMediumDFFontLimit = 70;
+static const int kLargeDFFontSize = 156;
+SK_COMPILE_ASSERT(GR_SDF_MAX_SIZE >= kLargeDFFontSize, sdf_too_big);
static const int kVerticesPerGlyph = 4;
static const int kIndicesPerGlyph = 6;
@@ -400,7 +402,7 @@ static void* alloc_vertices(GrDrawTarget* drawTarget,
}
void GrDistanceFieldTextContext::setupCoverageEffect(const SkColor& filteredColor) {
- GrTextureParams params(SkShader::kRepeat_TileMode, GrTextureParams::kBilerp_FilterMode);
+ GrTextureParams params(SkShader::kClamp_TileMode, GrTextureParams::kBilerp_FilterMode);
GrTextureParams gammaParams(SkShader::kClamp_TileMode, GrTextureParams::kNone_FilterMode);
uint32_t textureUniqueID = fCurrTexture->getUniqueID();
« no previous file with comments | « src/gpu/GrBitmapTextContext.cpp ('k') | src/gpu/GrFontAtlasSizes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698