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>
This commit is contained in:
Jim Van Verth 2018-03-29 13:46:56 -04:00 committed by Skia Commit-Bot
parent cf6da8c0f2
commit 76e851697b

View File

@ -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);