Chromium Code Reviews| Index: third_party/WebKit/Source/platform/fonts/win/FontPlatformDataWin.cpp |
| diff --git a/third_party/WebKit/Source/platform/fonts/win/FontPlatformDataWin.cpp b/third_party/WebKit/Source/platform/fonts/win/FontPlatformDataWin.cpp |
| index 6031bf38b05555976f1377310ae0c2c59977bf90..e6bc30fe118526c6bd7c0c23756eadf3dee679ef 100644 |
| --- a/third_party/WebKit/Source/platform/fonts/win/FontPlatformDataWin.cpp |
| +++ b/third_party/WebKit/Source/platform/fonts/win/FontPlatformDataWin.cpp |
| @@ -61,25 +61,16 @@ void FontPlatformData::setupPaint(SkPaint* paint, float, const Font*) const { |
| if (ts <= kMaxSizeForEmbeddedBitmap) |
| flags |= SkPaint::kEmbeddedBitmapText_Flag; |
| - if (ts >= m_minSizeForAntiAlias) { |
| - // Disable subpixel text for certain older fonts at smaller sizes as |
| - // they tend to get quite blurry at non-integer sizes and positions. |
| - // For high-DPI this workaround isn't required. |
| - if ((ts >= m_minSizeForSubpixel || |
| - FontCache::fontCache()->deviceScaleFactor() >= 1.5) |
| - |
| - // Subpixel text positioning looks pretty bad without font |
| - // smoothing. Disable it unless some type of font smoothing is used. |
| - // As most tests run without font smoothing we enable it for tests |
| - // to ensure we get good test coverage matching the more common |
| - // smoothing enabled behavior. |
| - && ((textFlags & SkPaint::kAntiAlias_Flag) || |
| - LayoutTestSupport::isRunningLayoutTest())) |
| - flags |= SkPaint::kSubpixelText_Flag; |
| - |
| - SkASSERT(!(textFlags & ~textFlagsMask)); |
| - flags |= textFlags; |
| - } |
| + // Subpixel text positioning leads to uneven spacing without font |
|
eae
2017/03/17 16:53:16
This explanation is a little confusing at first as
|
| + // smoothing. Subpixel test placement coordinates would be passed to Skia, |
| + // which only has non-antialiased glyphs to draw, so they necessarily get |
| + // clamped at pixel positions, which leads to uneven spacing, either too close |
| + // or too far away from adjacent glyphs. |
| + if (textFlags & SkPaint::kAntiAlias_Flag) |
| + flags |= SkPaint::kSubpixelText_Flag; |
| + |
| + SkASSERT(!(textFlags & ~textFlagsMask)); |
| + flags |= textFlags; |
| paint->setFlags(flags); |
| } |