Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / platform / fonts / win / FontPlatformDataWin.cpp
index 3980887..621e252 100644 (file)
@@ -64,13 +64,20 @@ void FontPlatformData::setupPaint(SkPaint* paint, GraphicsContext* context) cons
 
     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.