if (ts >= m_minSizeForAntiAlias) {
- // 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.
- if (m_useSubpixelPositioning && ts >= m_minSizeForSubpixel
- && ((textFlags & SkPaint::kAntiAlias_Flag) || LayoutTestSupport::isRunningLayoutTest()))
+ if (m_useSubpixelPositioning
+ // 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.
+ && (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;
// Only set painting flags when we're actually painting.