Revert "Do not use sub-pixel positioning for source space"

This reverts commit 7b56b0ae39.

Reason for revert: speculative: broke win7 layout tests

Original change's description:
> Do not use sub-pixel positioning for source space
> 
> Since the source space drawing modes call getGlyphMetrics with
> the point {0, 0}, just turn of sub-pixel positioning. This uses
> a more efficient code path in the strike
> 
> Change-Id: I360f56e1eede776dfa82db6b780b88c1fda50d36
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206701
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Ben Wagner <bungeman@google.com>
> Commit-Queue: Herb Derby <herb@google.com>
> Auto-Submit: Herb Derby <herb@google.com>

TBR=bungeman@google.com,herb@google.com

Change-Id: I06cafe542fe6374d1a273db09617dbebd9eb04c7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206696
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
This commit is contained in:
Mike Reed 2019-04-09 12:49:19 +00:00 committed by Skia Commit-Bot
parent d3516170ac
commit d9b8eed848
3 changed files with 1 additions and 9 deletions

View File

@ -124,9 +124,6 @@ SkScalar SkFont::setupForAsPaths(SkPaint* paint) {
this->setEdging(Edging::kAntiAlias);
}
// The sub-pixel position will always happen when transforming to the screen.
this->setSubpixel(false);
if (paint) {
paint->setStyle(SkPaint::kFill_Style);
paint->setPathEffect(nullptr);

View File

@ -333,9 +333,6 @@ void SkGlyphRunListPainter::processARGBFallback(SkScalar maxSourceGlyphDimension
SkFont fallbackFont{runFont};
fallbackFont.setSize(fallbackTextSize);
// No sub-pixel needed. The transform to the screen will take care of sub-pixel positioning.
fallbackFont.setSubpixel(false);
// The scale factor to go from strike size to the source size for glyphs.
SkScalar fallbackTextScale = runFontTextSize / fallbackTextSize;

View File

@ -172,9 +172,7 @@ SkFont GrTextContext::InitDistanceFieldFont(const SkFont& font,
dfFont.setEdging(SkFont::Edging::kAntiAlias);
dfFont.setForceAutoHinting(false);
dfFont.setHinting(kNormal_SkFontHinting);
// The sub-pixel position will always happen when transforming to the screen.
dfFont.setSubpixel(false);
dfFont.setSubpixel(true);
return dfFont;
}