aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Jim Van Verth <jvanverth@google.com>2018-03-29 13:46:56 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-29 18:18:55 +0000
commit76e851697b8a30d8aaae041f5e3e59d58f760b66 (patch)
tree4e48e99c4c1c8e1f56c0fb80cd6005f442099935
parentcf6da8c0f29877249a55949efd8b952b5b9bc01d (diff)
Snap non-scaled emoji to pixel borders
Bug: skia:7747 Change-Id: I9a083c2e98a58a847b8f0a37503a09fd94b6ae08 Reviewed-on: https://skia-review.googlesource.com/117184 Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
-rw-r--r--src/gpu/text/GrAtlasTextContext.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gpu/text/GrAtlasTextContext.cpp b/src/gpu/text/GrAtlasTextContext.cpp
index 0179e433cf..8f6cba0341 100644
--- a/src/gpu/text/GrAtlasTextContext.cpp
+++ b/src/gpu/text/GrAtlasTextContext.cpp
@@ -886,7 +886,6 @@ void GrAtlasTextContext::FallbackTextHelper::drawText(GrAtlasTextBlob* blob, int
skPaint.isDevKernText(), true);
SkColor textColor = paint.filteredPremulColor();
SkScalar textRatio = SK_Scalar1;
- fViewMatrix.mapPoints(fFallbackPos.begin(), fFallbackPos.count());
if (fUseScaledFallback) {
// Set up paint and matrix to scale glyphs
SkPaint scaledPaint(skPaint);
@@ -910,6 +909,11 @@ void GrAtlasTextContext::FallbackTextHelper::drawText(GrAtlasTextBlob* blob, int
SkPoint* glyphPos = fFallbackPos.begin();
while (text < stop) {
const SkGlyph& glyph = glyphCacheProc(cache.get(), &text);
+ fViewMatrix.mapPoints(glyphPos, 1);
+ if (!fUseScaledFallback) {
+ glyphPos->fX = SkScalarFloorToScalar(glyphPos->fX);
+ glyphPos->fY = SkScalarFloorToScalar(glyphPos->fY);
+ }
GrAtlasTextContext::BmpAppendGlyph(blob, runIndex, glyphCache, &currStrike, glyph,
glyphPos->fX, glyphPos->fY, textColor,
cache.get(), textRatio);